예제 #1
0
 def test_iterable(self):
     result = Result()
     results = ResultList()
     results.add(result)
     results.add(result)
     for res in results:
         self.assertEqual(res, result)
예제 #2
0
 def test_used_networks(self):
     wifi = WifiShardFactory.build()
     network = ('wifi', encode_mac(wifi.mac), True)
     assert Result().used_networks == []
     assert Result(used_networks=[network]).used_networks == [network]
예제 #3
0
 def test_data_accuracy(self):
     assert Result().data_accuracy is DataAccuracy.none
예제 #4
0
 def test_repr(self):
     result = Result(region_code='DE', lat=1.0)
     rep = repr(result)
     assert rep.startswith('Result')
     assert 'DE' not in rep
     assert '1.0' not in rep
예제 #5
0
 def test_data_accuracy(self):
     self.assertEqual(Result().data_accuracy, DataAccuracy.none)
예제 #6
0
 def test_repr(self):
     result = Result(region_code='DE', lat=1.0)
     rep = repr(result)
     self.assertTrue(rep.startswith('Result'), rep)
     self.assertFalse('DE' in rep, rep)
     self.assertFalse('1.0' in rep, rep)
예제 #7
0
 def test_len(self):
     results = ResultList()
     results.add(Result())
     results.add(Result())
     self.assertEqual(len(results), 2)
예제 #8
0
 def test_getitem(self):
     result = Result()
     results = ResultList()
     results.add(result)
     self.assertEqual(results[0], result)
예제 #9
0
 def test_add_many(self):
     results = ResultList(Result())
     results.add((Result(), Result()))
     self.assertEqual(len(results), 3)
예제 #10
0
 def test_init(self):
     results = ResultList(Result())
     self.assertEqual(len(results), 1)
예제 #11
0
 def test_satisfies(self):
     self.assertFalse(Result().satisfies(Query()))
예제 #12
0
 def test_empty(self):
     self.assertTrue(Result().empty())
예제 #13
0
 def test_repr(self):
     result = Result(region_code="DE", lat=1.0)
     rep = repr(result)
     assert rep.startswith("Result")
     assert "DE" not in rep
     assert "1.0" not in rep