def test_get_next_test(self): ''' Check get_next_test() works OK when we have more than one test ''' # # When we have more than one test, it should not return the # same test two times in a row. Not so clever, but that's # the way the current code is working. # lst = RunnerLst() lst.update({'foo': ['a', 'b', 'c'], 'bar': ['a', 'b', 'c']}) nxt = lst.get_next_test() self.assertNotEqual(lst.get_next_test(), nxt)
def test_get_next_test_simple(self): ''' Check get_next_test() works OK when we have just one test ''' # # When we have just one test it should always return that # test name, I know that seems silly but we need to ensure # it works OK because that is a special case in the code. # lst = RunnerLst() lst.update({'foo': ['a', 'b', 'c']}) self.assertEqual(lst.get_next_test(), 'foo') self.assertEqual(lst.get_next_test(), 'foo') self.assertEqual(lst.get_next_test(), 'foo')
def test_when_empty(self): ''' Check behavior is correct when empty ''' # It should return None in both cases lst = RunnerLst() self.assertEqual(lst.test_to_negotiate_uri('foo'), None) self.assertEqual(lst.get_next_test(), None)