Exemplo n.º 1
0
 def test_iterable(self):
     result = Result()
     results = ResultList()
     results.add(result)
     results.add(result)
     for res in results:
         self.assertEqual(res, result)
Exemplo n.º 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]
Exemplo n.º 3
0
 def test_data_accuracy(self):
     assert Result().data_accuracy is DataAccuracy.none
Exemplo n.º 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
Exemplo n.º 5
0
 def test_data_accuracy(self):
     self.assertEqual(Result().data_accuracy, DataAccuracy.none)
Exemplo n.º 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)
Exemplo n.º 7
0
 def test_len(self):
     results = ResultList()
     results.add(Result())
     results.add(Result())
     self.assertEqual(len(results), 2)
Exemplo n.º 8
0
 def test_getitem(self):
     result = Result()
     results = ResultList()
     results.add(result)
     self.assertEqual(results[0], result)
Exemplo n.º 9
0
 def test_add_many(self):
     results = ResultList(Result())
     results.add((Result(), Result()))
     self.assertEqual(len(results), 3)
Exemplo n.º 10
0
 def test_init(self):
     results = ResultList(Result())
     self.assertEqual(len(results), 1)
Exemplo n.º 11
0
 def test_satisfies(self):
     self.assertFalse(Result().satisfies(Query()))
Exemplo n.º 12
0
 def test_empty(self):
     self.assertTrue(Result().empty())
Exemplo n.º 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