Exemplo n.º 1
0
    def test_load(self):
        with self.subTest("tid"):
            trackable = Trackable(self.gc, "TB1KEZ9")
            self.assertEqual("Lilagul #2: SwedenHawk Geocoin", trackable.name)

        with self.subTest("trackable url"):
            url = "http://www.geocaching.com/track/details.aspx?guid=cff00ac4-f562-486e-b303-32b2d01ed386"
            trackable = Trackable(self.gc, None, url=url)
            self.assertEqual("Lilagul #2: SwedenHawk Geocoin", trackable.name)

        with self.subTest("fail lazyload"):
            trackable = Trackable(self.gc, None)
            with self.assertRaises(LoadError):
                trackable.name
Exemplo n.º 2
0
 def setUp(self):
     self.gc = Geocaching()
     self.t = Trackable("TB1234", self.gc, name="TrackMe")
     self.c = Cache("GC12345",
                    self.gc,
                    name="Testing",
                    cache_type="Traditional Cache",
                    location=Point(),
                    state=True,
                    found=False,
                    size="micro",
                    difficulty=1.5,
                    terrain=5,
                    author="human",
                    hidden=date(2000, 1, 1),
                    attributes={
                        "onehour": True,
                        "kids": False,
                        "available": True
                    },
                    summary="text",
                    description="long text",
                    hint="rot13",
                    favorites=0,
                    pm_only=False,
                    trackables=self.t)
Exemplo n.º 3
0
 def setUp(self):
     self.gc = Geocaching()
     self.t = Trackable("TB123AB",
                        self.gc,
                        name="Testing",
                        type="Travel Bug",
                        location=Point(),
                        owner="human",
                        description="long text",
                        goal="short text")
Exemplo n.º 4
0
 def setUp(self):
     self.gc = Geocaching()
     self.t = Trackable(self.gc,
                        "TB123AB",
                        name="Testing",
                        type="Travel Bug",
                        location="in the hands of human",
                        owner="human",
                        description="long text",
                        goal="short text")
     self.t._log_page_url = "/track/details.aspx?id=6359246"
Exemplo n.º 5
0
 def setUpClass(cls):
     cls.gc = Geocaching()
     cls.gc.login(_username, _password)
     cls.t = Trackable(cls.gc, "TB1KEZ9")
     cls.t.load()
Exemplo n.º 6
0
 def test___eq__(self):
     self.assertEqual(self.t, Trackable(self.gc, "TB123AB"))
Exemplo n.º 7
0
 def setUpClass(cls):
     super().setUpClass()
     cls.t = Trackable(cls.gc, "TB1KEZ9")
     with cls.recorder.use_cassette('trackable_setup'):
         cls.t.load()
Exemplo n.º 8
0
 def test_geocaching(self):
     with self.assertRaises(ValueError):
         Trackable("TB123AB", None)