Exemplo n.º 1
0
 def test_durationOfThreadIsAtleast3Sec(self):
     start = time.perf_counter()
     gd = GatherData()
     gd.getDataSource1()
     gd.getDataSource3()
     finish = time.perf_counter()
     self.assertTrue(finish - start > 3)
Exemplo n.º 2
0
 def test_durationOfMainThreadIsAtleast4Sec(self):
     start = time.perf_counter()
     gd = GatherData()
     gd.getDataSource1()
     gd.getDataSource2()
     gd.getDataSource3()
     gd.getDataSource4()
     finish = time.perf_counter()
     print(finish - start)
     self.assertTrue(finish - start > 4)
Exemplo n.º 3
0
 def test_gatherdata1_returns_list(self):
     gd = GatherData()
     actual = gd.getDataSource1()
     expected = []
     for i in range(1000000):
         expected.append(i)
     self.assertEqual(actual, expected)