chiark / gitweb /
add force_build_tools config option
[fdroidserver.git] / tests / build.TestCase
index 369c3836f250996e2ee0cd995e760aeb4b0f6ebb..9391a0423e01ef768621ce03d29d08e3772256f1 100755 (executable)
@@ -46,7 +46,7 @@ class BuildTest(unittest.TestCase):
                 self.assertTrue(os.path.exists(path))
                 self.assertTrue(os.path.isfile(path))
 
-    def test_adapt_gradle(self):
+    def test_force_gradle_build_tools(self):
         testsbase = os.path.join(os.path.dirname(__file__), '..', '.testfiles')
         if not os.path.exists(testsbase):
             os.makedirs(testsbase)
@@ -54,9 +54,7 @@ class BuildTest(unittest.TestCase):
         shutil.copytree(os.path.join(os.path.dirname(__file__), 'source-files'),
                         os.path.join(testsdir, 'source-files'))
         teststring = 'FAKE_VERSION_FOR_TESTING'
-        fdroidserver.build.config = {}
-        fdroidserver.build.config['build_tools'] = teststring
-        fdroidserver.build.adapt_gradle(testsdir)
+        fdroidserver.build.force_gradle_build_tools(testsdir, teststring)
         pattern = re.compile(bytes("buildToolsVersion[\s=]+'%s'\s+" % teststring, 'utf8'))
         for p in ('source-files/fdroid/fdroidclient/build.gradle',
                   'source-files/Zillode/syncthing-silk/build.gradle',
@@ -67,6 +65,7 @@ class BuildTest(unittest.TestCase):
                 filedata = f.read()
             self.assertIsNotNone(pattern.search(filedata))
 
+
 if __name__ == "__main__":
     parser = optparse.OptionParser()
     parser.add_option("-v", "--verbose", action="store_true", default=False,