-
Notifications
You must be signed in to change notification settings - Fork 5.9k
No hardcoded fileids #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No hardcoded fileids #683
Conversation
* Changed to new method of non-static file_id * removed obsolete tests.
* Changed to new method of non-static file_id * removed obsolete tests.
* Changed to new method of non-static file_id * removed obsolete tests.
Clean setUpClass + add assertions remove obsolete tests add test_expected_values
Py2 does not implement TestCase's assertions until setUp() is done. Hence we need simple assertions in the setUpClass
* Changed to new method of non-static file_id * removed obsolete tests.
* Changed to new method of non-static file_id * removed obsolete tests.
* Changed to new method of non-static file_id * removed obsolete tests. * changed some tests in all file
It now decides wich bot to give depending on CI, and made ready or more bot's per version.
* Audiofile sent from web is shorter then from local * web-photo's send more than two imagesizes
|
Ok, right now I expect the test_audio to throw an exception that should be fixed if the new audio-file is on master. Besides that I think this is about ready to merge |
|
Re: Travis: |
* cleanup assertions in test_video * modify test_sticker to same standard as the others.
* Added telegram.jpg to gitignore since we're downloading it now * moved download tests to the right tests to make test_file file_id free
|
Ok so I think it's about done now. |
|
On travis only expected tests failed. |
| c = telegram.File(self.audio_file_id, None) | ||
| d = telegram.File(self.document_file_id, self._bot) | ||
| e = telegram.Voice(self.audio_file_id, 0) | ||
| a = telegram.File("DOESNTMATTER", self._bot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically they do matter here. But it's fine :)
| @timeout(10) | ||
| def test_send_photo_url_png_file(self): | ||
| message = self._bot.sendPhoto( | ||
| photo='http://dummyimage.com/600x400/000/fff.png&text=telegram', chat_id=self._chat_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe use a photo in our github here? Not a fan of depending on external sites (anymore than we already do)
| @timeout(10) | ||
| def test_send_photo_url_gif_file(self): | ||
| message = self._bot.sendPhoto( | ||
| photo='http://dummyimage.com/600x400/000/fff.png&text=telegram', chat_id=self._chat_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment
| self.file_size = 39518 | ||
| @classmethod | ||
| def setUpClass(cls): | ||
| cls.emoji = telegram.Emoji.FLEXED_BICEPS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use the Emoji module as it's deprecated
| self.assertEqual(voice.duration, self.duration) | ||
| self.assertEqual(voice.mime_type, self.mime_type) | ||
| self.assertEqual(voice.file_size, self.file_size) | ||
| self.assertTrue(os.path.isfile('telegram.ogg')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(applies to all downloads)
Should we check against the local file, that they're the same?
|
Merged according to discussion in the developers group. |
Please do not merge, I want to see what travis thinks of this changes