Ejemplo n.º 1
0
 def test_invalid_format(self):
     checks = checkers.Checkers()
     conf1 = {'src1': '9b39f964848064045988688880149e7c'}
     conf2 = [{'src1': '9b39f964848064045988688880149e7c'},
              {'src2': '5d99b2d2051125a62f2086c9dcb2c558'},
              {'src3': '78e6620c1bd5cca6d818ba60310a4d8c'}]
     conf3 = None
     with pytest.raises(checkers.CheckerConfigError):
         checks.update(conf1)
     with pytest.raises(checkers.CheckerConfigError):
         checks.update(conf2)
     with pytest.raises(checkers.CheckerConfigError):
         checks.update(conf3)
Ejemplo n.º 2
0
 def test_deplicate_md5(self):
     checks = checkers.Checkers()
     config = {
         'src1': {
             'md5sum': '9b39f964848064045988688880149e7c'
         },
         'src2': {
             'md5sum': '5d99b2d2051125a62f2086c9dcb2c558'
         },
         'src3': {
             'md5sum': '78e6620c1bd5cca6d818ba60310a4d8c'
         }
     }
     config['src3']['md5sum'] = '9b39f964848064045988688880149e7c'
     with pytest.raises(checkers.CheckerConfigError):
         checks.update(config)
Ejemplo n.º 3
0
    def test_src(self):
        checks = checkers.Checkers()

        config = {
            'src1': {
                'md5sum': '9b39f964848064045988688880149e7c'
            },
            'src2': {
                'md5sum': '5d99b2d2051125a62f2086c9dcb2c558'
            },
            'src3': {
                'md5sum': '78e6620c1bd5cca6d818ba60310a4d8c'
            }
        }

        checks.update(config)

        check = checks.detect_checker(examples_path('src1.zoo'))
        assert check == 'src1'
        check = checks.detect_checker(examples_path('src2.zoo'))
        assert check == 'src2'
        check = checks.detect_checker(examples_path('src3.zpp'))
        assert check == 'src3'
Ejemplo n.º 4
0
 def test_empty_checkers(self):
     checks = checkers.Checkers()
     assert checks.checkers == {}
     assert checks.detect_checker(examples_path('src1.zoo')) is None
Ejemplo n.º 5
0
 def test_empty(self):
     checks = checkers.Checkers()
     checks.update({})
     assert checks.checkers == {}