Exemple #1
0
    def test_update_from_dict(self):
        gmap = GnomeMap()

        json_ = {'map_bounds': [(-10, 10), (10, 10), (10, -10), (-10, -10)]}
        assert np.all(gmap.map_bounds != json_['map_bounds'])
        gmap.update_from_dict(json_)
        assert np.all(gmap.map_bounds == json_['map_bounds'])
Exemple #2
0
    def test_update_from_dict(self):
        gmap = GnomeMap()

        json_ = gmap.serialize('save')
        json_['map_bounds'] = [(-10, 10), (10, 10), (10, -10), (-10, -10)]

        dict_ = gnome.map.GnomeMap.deserialize(json_)

        gmap.update_from_dict(dict_)
        u_json_ = gmap.serialize('save')

        for key in json_:
            assert u_json_[key] == json_[key]
Exemple #3
0
    def test_update_from_dict(self):
        gmap = GnomeMap()

        json_ = gmap.serialize('save')
        json_['map_bounds'] = [(-10, 10), (10, 10),
                               (10, -10), (-10, -10)]

        dict_ = gnome.map.GnomeMap.deserialize(json_)

        gmap.update_from_dict(dict_)
        u_json_ = gmap.serialize('save')

        for key in json_:
            assert u_json_[key] == json_[key]