Пример #1
0
    def test_table_adding_options(self):
        t = Table('test', load_from_name=False)
        t.add_option(1, 2, 'result1', leads_to=None, identifier='first0')
        t.add_option(3, 3, 'result2', leads_to=None, identifier='first1')

        self.assertEqual(t.get_result(index=1), 'result1')
        self.assertEqual(t.get_result(index=2), 'result1')
        self.assertEqual(t.get_result(index=3), 'result2')
Пример #2
0
 def test_table_random_result(self):
     t = Table('test', load_from_name=False)
     t.add_option(1, 1, 'result', leads_to=None, identifier='first')
     result = t.random_result()
     self.assertEqual(result, 'result')