Пример #1
0
 def test_01_01_dont_update(self):
     url = "file:" + urllib.pathname2url(self.name)
     def fn(new_version, info):
         self.fail("We should not update")
     vc = cfu.VersionChecker(url, FAKE_VERSION + 1, fn, 
                             'CellProfiler_unit_test')
     vc.start()
     vc.join()
    def test_01_03_website(self):
        url = 'http://cellprofiler.org/CPupdate.html'
        we_updated = [False]

        def fn(new_version, info, we_updated=we_updated):
            we_updated[0] = True

        vc = cfu.VersionChecker(url, 0, fn, 'CellProfiler_unit_test')
        vc.start()
        vc.join()
        self.assertTrue(we_updated[0])
Пример #3
0
 def test_01_02_update(self):
     url = "file:" + urllib.pathname2url(self.name)
     we_updated = [False]
     def fn(new_version, info, we_updated = we_updated):
         self.assertEqual(new_version, FAKE_VERSION)
         self.assertEqual(info, FAKE_RELEASENOTES)
         we_updated[0] = True
     vc = cfu.VersionChecker(url, FAKE_VERSION - 1, fn, 
                             'CellProfiler_unit_test')
     vc.start()
     vc.join()
     self.assertTrue(we_updated[0])