Skip to content

Conversation

@Eldinnie
Copy link
Member

Please do not merge, I want to see what travis thinks of this changes

Eldinnie added 8 commits June 20, 2017 23:55
* 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
@Eldinnie Eldinnie self-assigned this Jun 21, 2017
@Eldinnie Eldinnie added enhancement ⚙️ tests affected functionality: tests labels Jun 21, 2017
Eldinnie added 9 commits June 21, 2017 17:21
* 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
@Eldinnie
Copy link
Member Author

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

@Eldinnie Eldinnie requested review from jh0ker, jsmnbom and tsnoam June 21, 2017 17:04
@Eldinnie
Copy link
Member Author

Eldinnie commented Jun 21, 2017

Re: Travis:
Only the two tests I expected te fail do so test_send_audio_mp3_url_file and test_send_audio_mp3_url_file_with_caption The rest is good.
Those error should be fixed when the new shorter audiofile is on the master branch

Eldinnie added 4 commits June 22, 2017 17:17
* 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
@Eldinnie
Copy link
Member Author

Ok so I think it's about done now. test_send_audio_mp3_url_file, test_send_audio_mp3_url_file_with_caption and test_send_sticker_from_url are expected to fail until the files are adjusted/added on the master branch.

@Eldinnie
Copy link
Member Author

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

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'))
Copy link
Member

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?

@tsnoam
Copy link
Member

tsnoam commented Jun 22, 2017

Merged according to discussion in the developers group.

@tsnoam tsnoam merged commit 8703ae0 into master Jun 22, 2017
@tsnoam tsnoam deleted the no_hardcoded_fileids branch June 22, 2017 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2020
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement ⚙️ tests affected functionality: tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants