def version_run(o): execute(o['--plugins-version'], o['--core-version'], o['--config'], o['--base-dir'], o['--prerelease'], o['--validate'], o['--verbose'])
def test_single_file(self): working_dir = os.path.join(TEST_RESOURCES_DIR, 'single-file') vc.execute("1.1", "3.1", SINGLE_FILE_CONFIG, 'version_control/tests/resources', 'm6', verbose=True) with open(os.path.join(working_dir + '/check_changed/VERSION')) as f: content = f.read() self.assertIn('3.1.0-m6', content) self.assertNotIn('3.1.0-m5', content) with open(os.path.join(working_dir + '/check_unchanged/VERSION')) as f: content = f.read() self.assertIn('3.1.0-m5', content) self.assertNotIn('3.1.0-m6', content)
def test_single_file(self): working_dir = os.path.join(TEST_RESOURCES_DIR, 'single-file') vc.execute("1.1", "3.1", SINGLE_FILE_CONFIG, 'version_control/tests/resources', 'm6', verbose=True) with open(os.path.join(working_dir + '/check_changed/VERSION')) as f: content = f.read() self.assertIn('3.1.0-m6', content) self.assertNotIn('3.1.0-m5', content) with open(os.path.join(working_dir + '/check_unchanged/VERSION')) as f: content = f.read() self.assertIn('3.1.0-m5', content) self.assertNotIn('3.1.0-m6', content)
def test_version(self): test_dirs = os.listdir(TEST_RESOURCES_DIR) for test_dir in test_dirs: if os.path.isdir(os.path.join(TEST_RESOURCES_DIR, test_dir)) \ and test_dir.startswith('cloudify-'): print test_dir input = TEST_RESOURCES_DIR + test_dir + '/input' working_dir = TEST_RESOURCES_DIR + test_dir + '/work-copy' expected_output = \ TEST_RESOURCES_DIR + test_dir + '/expected-output' if not os.path.exists(input): continue shutil.rmtree(working_dir, ignore_errors=True) # Copy the input because the files will be changed in place shutil.copytree(input, working_dir) vc.execute("1.1", "3.1", TEST_RESOURCES_DIR + 'config.yaml', working_dir, 'm6', verbose=True) res = filecmp.dircmp(working_dir, expected_output) try: self.assertEquals(0, len(res.diff_files)) for sd in res.subdirs.itervalues(): print sd.diff_files self.assertEquals(0, len(sd.diff_files)) except AssertionError: filecmp.dircmp(working_dir, expected_output)\ .report_full_closure() raise
def test_version(self): test_dirs = os.listdir(TEST_RESOURCES_DIR) for test_dir in test_dirs: if os.path.isdir(os.path.join(TEST_RESOURCES_DIR, test_dir)) \ and test_dir.startswith('cloudify-'): print test_dir input = TEST_RESOURCES_DIR + test_dir + '/input' working_dir = TEST_RESOURCES_DIR + test_dir + '/work-copy' expected_output = \ TEST_RESOURCES_DIR + test_dir + '/expected-output' if not os.path.exists(input): continue shutil.rmtree(working_dir, ignore_errors=True) # Copy the input because the files will be changed in place shutil.copytree(input, working_dir) vc.execute("1.1", "3.1", TEST_RESOURCES_DIR + 'config.yaml', working_dir, 'm6', verbose=True) res = filecmp.dircmp(working_dir, expected_output) try: self.assertEquals(0, len(res.diff_files)) for sd in res.subdirs.itervalues(): print sd.diff_files self.assertEquals(0, len(sd.diff_files)) except AssertionError: filecmp.dircmp(working_dir, expected_output)\ .report_full_closure() raise
def version_run(o): execute(o['--plugins-version'], o['--core-version'], o['--config'], o['--base-dir'], o['--prerelease'], o['--validate'], o['--verbose'])