def test_url(self): def get(url): self.assertEqual( "https://cloud-images.ubuntu.com/query/released.latest.txt", url) return MockResponse("raring server release 20130824") _find_latest_release(MockSession(get))
def test_finds_latest_release(self): with open( os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", "releases.txt")) as f: data = f.read() get = lambda url: MockResponse(data) self.assertEqual("raring", _find_latest_release(MockSession(get)))
def test_finds_latest_release(self): with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", "releases.txt")) as f: data = f.read() get = lambda url: MockResponse(data) self.assertEqual("raring", _find_latest_release(MockSession(get)))
def test_url(self): def get(url): self.assertEqual("https://cloud-images.ubuntu.com/query/released.latest.txt", url) return MockResponse("raring server release 20130824") _find_latest_release(MockSession(get))