Merge pull request #2 from Dineshkarthik/ci_codecov

CI -Testing
This commit is contained in:
Dineshkarthik R 2019-08-06 16:47:02 +02:00 committed by GitHub
commit b5c23d40d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 83 additions and 4 deletions

77
.circleci/config.yml Normal file
View file

@ -0,0 +1,77 @@
version: 2
jobs:
test-3.5:
docker:
- image: circleci/python:3.6.7
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
LOG_DIR: ${CIRCLE_ARTIFACTS}/testresults/
steps:
- checkout
- run:
name: Get setuptools
shell: /bin/bash
command: sudo pip install --upgrade pip setuptools codecov
- run:
name: Run test
shell: /bin/bash
command: |
sudo make -e test
codecov
- store_artifacts:
path: /tmp/circleci-artifacts
test-3.6:
docker:
- image: circleci/python:3.6.5
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
LOG_DIR: ${CIRCLE_ARTIFACTS}/testresults/
steps:
- checkout
- run:
name: Get setuptools
shell: /bin/bash
command: sudo pip install --upgrade pip setuptools codecov
- run:
name: Run test
shell: /bin/bash
command: |
sudo make -e test
codecov
- store_artifacts:
path: /tmp/circleci-artifacts
test-3.7:
docker:
- image: circleci/python:3.7.3
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
LOG_DIR: ${CIRCLE_ARTIFACTS}/testresults/
steps:
- checkout
- run:
name: Get setuptools
shell: /bin/bash
command: sudo pip install --upgrade pip setuptools codecov
- run:
name: Run test
shell: /bin/bash
command: |
sudo make -e test
codecov
- store_artifacts:
path: /tmp/circleci-artifacts
workflows:
version: 2
tests:
jobs:
- test-3.5
- test-3.6
- test-3.7

View file

@ -2,7 +2,9 @@
<h1 align="center">Telegram Media Downloader</h1> <h1 align="center">Telegram Media Downloader</h1>
<p align="center"> <p align="center">
<a href="https://github.com/Dineshkarthik/Whatsapp-analyzer/blob/master/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a> <a href="https://circleci.com/gh/Dineshkarthik/telegram_media_downloader/tree/master"><img alt="Build Status" src="https://circleci.com/gh/Dineshkarthik/telegram_media_downloader.svg?style=svg"></a>
<a href="https://codecov.io/gh/Dineshkarthik/telegram_media_downloader"><img alt="Coverage Status" src="https://codecov.io/gh/Dineshkarthik/telegram_media_downloader/branch/master/graph/badge.svg"></a>
<a href="https://github.com/Dineshkarthik/telegram_media_downloader/blob/master/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a>
<a href="https://github.com/python/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> <a href="https://github.com/python/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p> </p>

View file

@ -38,7 +38,7 @@ def _get_media_meta(media_obj: object, _type: str) -> Tuple[str, str]:
THIS_DIR, THIS_DIR,
_type, _type,
"voice_{}.{}".format( "voice_{}.{}".format(
dt.fromtimestamp(media_obj.date).isoformat(), file_format dt.utcfromtimestamp(media_obj.date).isoformat(), file_format
), ),
) )
elif _type == "photo": elif _type == "photo":

View file

@ -85,7 +85,7 @@ class MockClient:
def download_media(self, *args, **kwargs): def download_media(self, *args, **kwargs):
assert "AwADBQADbwAD2oTRVeHe5eXRFftfAg", args[0] assert "AwADBQADbwAD2oTRVeHe5eXRFftfAg", args[0]
assert "/root/project/voice/voice_2019-07-25T16:53:50.ogg", kwargs[ assert "/root/project/voice/voice_2019-07-25T14:53:50.ogg", kwargs[
"file_name" "file_name"
] ]
return kwargs["file_name"] return kwargs["file_name"]
@ -108,7 +108,7 @@ class MediaDownloaderTestCase(unittest.TestCase):
self.assertEqual( self.assertEqual(
( (
"AwADBQADbwAD2oTRVeHe5eXRFftfAg", "AwADBQADbwAD2oTRVeHe5eXRFftfAg",
"/root/project/voice/voice_2019-07-25T16:53:50.ogg", "/root/project/voice/voice_2019-07-25T14:53:50.ogg",
), ),
result, result,
) )