def relation(self, n): assert_equals(n.id, 1) assert_equals(n.deleted, False) assert_equals(n.visible, True) assert_equals(n.version, 5) assert_equals(n.changeset, 58674) assert_equals(n.uid, 42) assert_equals(n.user_is_anonymous(), False) assert_equals(n.timestamp, mkdate(2014, 1, 31, 6, 23, 35)) assert_equals(n.user, 'anonymous') assert_equals(n.positive_id(), 1) assert_true(check_repr(n)) assert_true(check_repr(n.members))
def relation(o): assert o.id == 1 assert o.deleted == False assert o.visible == True assert o.version == 5 assert o.changeset == 58674 assert o.uid == 42 assert o.user_is_anonymous() == False assert o.timestamp == mkdate(2014, 1, 31, 6, 23, 35) assert o.user == ' anonymous' assert o.positive_id() == 1 assert check_repr(o) assert check_repr(o.members)
def relation(self, n): assert_equals(n.id, 1) assert_equals(n.deleted, False) assert_equals(n.visible, True) assert_equals(n.version, 5) assert_equals(n.changeset, 58674) assert_equals(n.uid, 42) assert_equals(n.user_is_anonymous(), False) assert_equals(n.timestamp, mkdate(2014, 1, 31, 6, 23, 35)) assert_equals(n.user, ' anonymous') assert_equals(n.positive_id(), 1) assert_true(check_repr(n)) assert_true(check_repr(n.members))
def test_valid_location(self): loc = o.osm.Location(1,10) assert_equals(loc.lon, 1, 0.0001) assert_equals(loc.lat, 10, 0.00001) assert_equals(loc.x, 10000000) assert_equals(loc.y, 100000000) assert_true(check_repr(loc))
def way(self, n): assert_equals(n.id, 1) assert_equals(n.deleted, False) assert_equals(n.visible, True) assert_equals(n.version, 5) assert_equals(n.changeset, 58674) assert_equals(n.uid, 42) assert_equals(n.user_is_anonymous(), False) assert_equals(n.timestamp, mkdate(2014, 1, 31, 6, 23, 35)) assert_equals(n.user, 'anonymous') assert_equals(n.positive_id(), 1) assert_false(n.is_closed()) assert_false(n.ends_have_same_id()) assert_false(n.ends_have_same_location()) assert_true(check_repr(n)) assert_true(check_repr(n.nodes))
def way(o): assert o.id == 1 assert o.deleted == False assert o.visible == True assert o.version == 5 assert o.changeset == 58674 assert o.uid == 42 assert o.user_is_anonymous() == False assert o.timestamp == mkdate(2014, 1, 31, 6, 23, 35) assert o.user == 'anonymous' assert o.positive_id() == 1 assert not o.is_closed() assert not o.ends_have_same_id() assert not o.ends_have_same_location() assert check_repr(o) assert check_repr(o.nodes)
def test_valid_location(self): loc = o.osm.Location(1, 10) assert_equals(loc.lon, 1, 0.0001) assert_equals(loc.lat, 10, 0.00001) assert_equals(loc.x, 10000000) assert_equals(loc.y, 100000000) assert_true(check_repr(loc))
def test_valid_location(): loc = o.osm.Location(1, 10) assert loc.lon == pytest.approx(1) assert loc.lat == pytest.approx(10) assert loc.x == 10000000 assert loc.y == 100000000 assert check_repr(loc)
def node(self, n): assert_in("abba", n.tags) assert_in("2", n.tags) assert_in("xx", n.tags) assert_not_in("x", n.tags) assert_not_in(None, n.tags) assert_not_in("", n.tags) assert_true(check_repr(n.tags))
def test_invalid_location(self): loc = o.osm.Location() assert_false(loc.valid()) assert_true(check_repr(loc)) with assert_raises(o.InvalidLocationError): lat = loc.lat with assert_raises(o.InvalidLocationError): lon = loc.lon # these two don't raise an exception lat = loc.lat_without_check() lon = loc.lon_without_check()
def test_invalid_location(): loc = o.osm.Location() assert not loc.valid() assert check_repr(loc) with pytest.raises(o.InvalidLocationError): lat = loc.lat with pytest.raises(o.InvalidLocationError): lon = loc.lon # these two don't raise an exception lat = loc.lat_without_check() lon = loc.lon_without_check()
def node(n): assert n.deleted == False assert n.visible == True assert n.version == 5 assert n.changeset == 58674 assert n.uid == 42 assert n.user_is_anonymous() == False assert n.timestamp == mkdate(2014, 1, 31, 6, 23, 35) assert n.user == u'änonymous' assert n.positive_id() == 1 assert check_repr(n)
def changeset(c): assert 34 == c.id assert 1 == c.uid assert not c.user_is_anonymous() assert "Steve" == c.user assert mkdate(2005, 4, 9, 19, 54, 13), c.created_at assert mkdate(2005, 4, 9, 20, 54, 39), c.closed_at assert not c.open assert 2 == c.num_changes assert 0 == len(c.tags) assert -1464925 == c.bounds.top_right.x assert 515288620 == c.bounds.top_right.y assert -1465242 == c.bounds.bottom_left.x assert 515288506 == c.bounds.bottom_left.y assert check_repr(c)
def changeset(self,c): assert_equals(34, c.id) assert_equals(1, c.uid) assert_false(c.user_is_anonymous()) assert_equals("Steve", c.user) assert_equals(mkdate(2005, 4, 9, 19, 54, 13), c.created_at) assert_equals(mkdate(2005, 4, 9, 20, 54, 39), c.closed_at) assert_false(c.open) assert_equals(2, c.num_changes) assert_equals(0, len(c.tags)) assert_equals(-1464925, c.bounds.top_right.x) assert_equals(515288620, c.bounds.top_right.y) assert_equals(-1465242, c.bounds.bottom_left.x) assert_equals(515288506, c.bounds.bottom_left.y) assert_true(check_repr(c))
def changeset(self, c): assert_equals(34, c.id) assert_equals(1, c.uid) assert_false(c.user_is_anonymous()) assert_equals("Steve", c.user) assert_equals(mkdate(2005, 4, 9, 19, 54, 13), c.created_at) assert_equals(mkdate(2005, 4, 9, 20, 54, 39), c.closed_at) assert_false(c.open) assert_equals(2, c.num_changes) assert_equals(0, len(c.tags)) assert_equals(-1464925, c.bounds.top_right.x) assert_equals(515288620, c.bounds.top_right.y) assert_equals(-1465242, c.bounds.bottom_left.x) assert_equals(515288506, c.bounds.bottom_left.y) assert_true(check_repr(c))
def relation(self, r): m = list(r.members) eq_(4, len(m)) eq_(23, m[0].ref) eq_('n', m[0].type) eq_('', m[0].role) eq_(12, m[1].ref) eq_('n', m[1].type) eq_('foo', m[1].role) eq_(5, m[2].ref) eq_('w', m[2].type) eq_('.', m[2].role) eq_(34359737784, m[3].ref) eq_('r', m[3].type) eq_(u'(ü)', m[3].role) assert_true(check_repr(m))
def node(self, n): assert_true(n.tags) assert_equals(self.expected_len[n.id], len(n.tags)) assert_true(check_repr(n.tags))
def node(n): if None in tags: del tags[None] tags.update(n.tags) tests(n) assert check_repr(n.tags)
def test_invalid_location(self): loc = o.osm.Location() assert_false(loc.valid()) assert_true(check_repr(loc))