Exemplo n.º 1
0
    def __checkPackageVersions(self, appinfo):
        if appinfo is None:
            return pv.PLUGIN_MUST_BE_UPGRADED

        api_required_versions = appinfo.requirements.api_list

        return pv.checkVersion(outwiker.__api_version__, api_required_versions)
Exemplo n.º 2
0
 def test_less_major(self):
     packageVersion = (1, 10)
     required = (2, 1)
     self.assertEqual(pv.checkVersion(packageVersion, required),
                      pv.OUTWIKER_MUST_BE_UPGRADED)
Exemplo n.º 3
0
 def test_equal(self):
     packageVersion = (1, 1)
     required = (1, 1)
     self.assertEqual(pv.checkVersion(packageVersion, required),
                      pv.VERSION_OK)
Exemplo n.º 4
0
 def test_fail_03(self):
     current_api_version = (2, 0)
     required = [(1, 0)]
     self.assertEqual(pv.checkVersion(current_api_version, required),
                      pv.PLUGIN_MUST_BE_UPGRADED)
Exemplo n.º 5
0
 def test_great_major(self):
     packageVersion = (2, 10)
     required = (1, 1)
     self.assertEqual(pv.checkVersion(packageVersion, required),
                      pv.PLUGIN_MUST_BE_UPGRADED)
Exemplo n.º 6
0
 def test_fail_01(self):
     current_api_version = (2, 0)
     required = [(1, 1), (3, 0)]
     self.assertNotEqual(pv.checkVersion(current_api_version, required),
                         pv.VERSION_OK)
Exemplo n.º 7
0
 def test_fail_02(self):
     current_api_version = (2, 10)
     required = [(2, 15)]
     self.assertEqual(pv.checkVersion(current_api_version, required),
                      pv.OUTWIKER_MUST_BE_UPGRADED)
Exemplo n.º 8
0
 def test_ok_06(self):
     current_api_version = (2, 10)
     required = [(2, 0)]
     self.assertEqual(pv.checkVersion(current_api_version, required),
                      pv.VERSION_OK)
Exemplo n.º 9
0
 def test_ok_empty(self):
     current_api_version = (1, 1)
     required = []
     self.assertEqual(pv.checkVersion(current_api_version, required),
                      pv.VERSION_OK)
Exemplo n.º 10
0
 def test_equal(self):
     packageVersion = (1, 1)
     required = (1, 1)
     self.assertEqual(pv.checkVersion(packageVersion, required),
                      pv.VERSION_OK)
Exemplo n.º 11
0
 def test_less_major(self):
     packageVersion = (1, 10)
     required = (2, 1)
     self.assertEqual(pv.checkVersion(packageVersion, required),
                      pv.OUTWIKER_MUST_BE_UPGRADED)
Exemplo n.º 12
0
 def test_great_major(self):
     packageVersion = (2, 10)
     required = (1, 1)
     self.assertEqual(pv.checkVersion(packageVersion, required),
                      pv.PLUGIN_MUST_BE_UPGRADED)