Exemplo n.º 1
0
    def test_generate_teams(self):
        data_struct = generate_data_structure(
            'a2|'
            ' **qg** [](#qg) |'
            'vs.|'
            ' [](#dig) **dig** |'
            ' [picks & bans](http://www.twitch.tv/esl_lol/v/30574431?t=1h47m41s) |'
            ' [game start](http://www.twitch.tv/esl_lol/v/30574431?t=1h57m05s) |'
            ' [picks & bans](https://www.youtube.com/watch?v=ytsjecr73nk) |'
            ' [game start](https://www.youtube.com/watch?v=ytsjecr73nk&t=7m45s) |'
            ' [highlights](https://www.youtube.com/watch?v=j67z3z9gnsc) |',
            'title')
        self.assertTrue('qg' in data_struct['blue_team'])
        self.assertTrue('dig' in data_struct['red_team'])
        self.assertTrue('a2' in data_struct['local_id'])
        self.assertIsNotNone(data_struct['pick_ban'])
        self.assertIsNotNone(data_struct['pick_ban']['twitch'])
        self.assertIsNotNone(data_struct['pick_ban']['youtube'])
        self.assertIsNotNone(data_struct['game_start'])
        self.assertIsNotNone(data_struct['game_start']['youtube'])
        self.assertEqual(data_struct['game_start']['youtube'],
                         ' [game start](https://www.youtube.com/watch?v=ytsjecr73nk&t=7m45s) ')
        self.assertIsNotNone(data_struct['highlights'])

        if __name__ == '__main__':
            unittest.main()
Exemplo n.º 2
0
    def test_generate_teams(self):
        data_struct = generate_data_structure(
            'a2|'
            ' **qg** [](#qg) |'
            'vs.|'
            ' [](#dig) **dig** |'
            ' [picks & bans](http://www.twitch.tv/esl_lol/v/30574431?t=1h47m41s) |'
            ' [game start](http://www.twitch.tv/esl_lol/v/30574431?t=1h57m05s) |'
            ' [picks & bans](https://www.youtube.com/watch?v=ytsjecr73nk) |'
            ' [game start](https://www.youtube.com/watch?v=ytsjecr73nk&t=7m45s) |'
            ' [highlights](https://www.youtube.com/watch?v=j67z3z9gnsc) |',
            'title')
        self.assertTrue('qg' in data_struct['blue_team'])
        self.assertTrue('dig' in data_struct['red_team'])
        self.assertTrue('a2' in data_struct['local_id'])
        self.assertIsNotNone(data_struct['pick_ban'])
        self.assertIsNotNone(data_struct['pick_ban']['twitch'])
        self.assertIsNotNone(data_struct['pick_ban']['youtube'])
        self.assertIsNotNone(data_struct['game_start'])
        self.assertIsNotNone(data_struct['game_start']['youtube'])
        self.assertEqual(
            data_struct['game_start']['youtube'],
            ' [game start](https://www.youtube.com/watch?v=ytsjecr73nk&t=7m45s) '
        )
        self.assertIsNotNone(data_struct['highlights'])

        if __name__ == '__main__':
            unittest.main()
Exemplo n.º 3
0
 def test_generate_any_json(self):
     data_struct = generate_data_structure(
         'a2| **qg** [](#qg) |vs.| [](#dig) **dig** | [picks & bans]'
         '(http://www.twitch.tv/esl_lol/v/30574431?t=1h47m41s) | '
         '[game start](http://www.twitch.tv/esl_lol/v/30574431?t=1h57m05s)'
         ' | [picks & bans](https://www.youtube.com/watch?v=ytsjecr73nk)'
         ' | [game start](https://www.youtube.com/watch?v=ytsjecr73nk&t=7m45s)'
         ' | [highlights](https://www.youtube.com/watch?v=j67z3z9gnsc)'
         ' |', 'title')
     self.assertIsNotNone(data_struct)
Exemplo n.º 4
0
 def test_generate_any_json(self):
     data_struct = generate_data_structure(
         'a2| **qg** [](#qg) |vs.| [](#dig) **dig** | [picks & bans]'
         '(http://www.twitch.tv/esl_lol/v/30574431?t=1h47m41s) | '
         '[game start](http://www.twitch.tv/esl_lol/v/30574431?t=1h57m05s)'
         ' | [picks & bans](https://www.youtube.com/watch?v=ytsjecr73nk)'
         ' | [game start](https://www.youtube.com/watch?v=ytsjecr73nk&t=7m45s)'
         ' | [highlights](https://www.youtube.com/watch?v=j67z3z9gnsc)'
         ' |', 'title')
     self.assertIsNotNone(data_struct)