예제 #1
0
 def test_findsAll(self):
     (status, successful, failed,
      ignored) = validator.validate_cwd('', schema, build_map)
     self.assertEqual(status, 1)
     self.assertSetEqual(successful, {Path('CAPS.VERSION')})
     self.assertSetEqual(failed, {Path('camelCaseVersionMissing.Version')})
     # Make sure 'not-detected.version.json' has not been detected.
     self.assertSetEqual(ignored, set())
예제 #2
0
def validate_current_repository():
    debug = str_to_bool(os.getenv('INPUT_DEBUG', 'false'))
    setup_logger(debug)

    exclude = os.getenv('INPUT_EXCLUDE', '')

    (status, successful, failed, ignored) = validate_cwd(exclude)
    print(f'Exiting with status {status}: {len(successful)} successful, {len(failed)} failed, {len(ignored)} ignored.')
    exit(status)
예제 #3
0
 def test_recursiveExclusion(self):
     (status, successful, failed,
      ignored) = validator.validate_cwd('["./recursiveness/**/*"]', schema,
                                        build_map)
     self.assertEqual(status, 1)
     self.assertSetEqual(successful, {Path('default.version')})
     self.assertSetEqual(
         ignored, {
             Path('recursiveness/recursive.version'),
             Path('recursiveness/recursiveness2/recursive2.version')
         })
     self.assertEqual(failed, {Path('failing/failing-validation.version')})
예제 #4
0
 def test_exclusionWildcard(self):
     (status, successful, failed,
      ignored) = validator.validate_cwd('failing/*.version', schema,
                                        build_map)
     self.assertEqual(status, 0)
     self.assertSetEqual(
         successful, {
             Path('default.version'),
             Path('recursiveness/recursive.version'),
             Path('recursiveness/recursiveness2/recursive2.version')
         })
     self.assertSetEqual(ignored,
                         {Path('failing/failing-validation.version')})
     self.assertEqual(failed, set())
예제 #5
0
 def test_invalidWorkspace_recursive(self):
     (status, successful, failed,
      ignored) = validator.validate_cwd('', schema, build_map)
     self.assertEqual(status, 1)
예제 #6
0
 def test_doubleQuotation(self):
     (status, successful, failed, ignored) = validator.validate_cwd(
         '"failing/failing-validation.version"', schema, build_map)
     self.assertEqual(status, 0)
예제 #7
0
 def test_validRemote_cwd(self):
     (status, successful, failed,
      ignored) = validator.validate_cwd('', schema, build_map)
     self.assertIn(Path('valid-remote.version'), successful)