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