Commit graph

19 commits

Author SHA1 Message Date
Jana Cupova
c310d6692d Pytest instead of nose in unittest
Fixes: https://pagure.io/koji/issue/3140
2021-12-06 12:17:29 +01:00
Yu Ming Zhu
cdbebd963d [hub] add non-host evalPolicy API 2021-08-16 17:55:26 +00:00
Yu Ming Zhu
601cd33902 use scm_ as the prefix instead of scm for scminfo 2021-08-16 17:55:26 +00:00
Yu Ming Zhu
47c4b5d70b kojid: extend SCM.assert_allowed with hub policy
This is a simple extention of `SCM.assert_allowed`

- `assert_allowed_by_policy` will set the default "use_common" to False which is different to the old behavior
- `channel`, `user_id`, `scratch` are passed in the `policy_data` with scminfo right now.

This is a prototype for this change, and there are some other solutions could be implemented too

- Use a scmpolicy plugin as `postSCMCheckout` callback, the pro is that we can do more checks after the source is initialized on builder, meanwhile, the con is that the source will be downloaded even it is denied by policy. It might be a potential risk?
- Do the scm check in hub's `make_task`, this looks straightforward, but may lack some builder's information

fixes: #2757
2021-08-16 17:55:26 +00:00
Tomas Kopecek
b030b46f74 remove unittest2 2020-10-06 15:00:23 +02:00
Tomas Kopecek
cbc7e85de0 fix unittest for py3 2019-02-20 15:30:01 -05:00
Tomas Kopecek
051a0d5230 py3 checks file path, so it needs to be non-mocked string 2019-02-19 17:29:25 -05:00
Tomas Kopecek
7f6b717eb6 python-modernize -f libmodernize.fixes.fix_import 2018-07-11 17:37:39 -04:00
Tomas Kopecek
c68396c059 Use unittest2 for rhel6 compatibility
Fixes: https://pagure.io/koji/issue/830
2018-06-07 09:39:39 -04:00
Yuming Zhu
c008ac8bb9 unittest for scm.get_source 2018-03-14 19:10:12 +08:00
Mike McLean
c457d07246 fix up url checks and extend unit tests for this issue 2017-09-19 14:43:23 -04:00
Mike McLean
3b66a81bfc rename variable in unit test. clarify docstring 2017-05-22 15:49:38 -04:00
Mike McLean
38c45ee124 another bad url for assert_allowed test 2017-05-22 15:49:38 -04:00
Mike McLean
5e19c06fce more tests 2017-05-22 15:49:38 -04:00
Mike McLean
c49d8552b8 another test 2017-05-22 15:49:38 -04:00
Mike McLean
49b4d0ae9f another test 2017-05-22 15:49:38 -04:00
Mike McLean
b4ea7c2189 a checkout test 2017-05-22 15:49:38 -04:00
Mike McLean
04b42c8320 tests/fixes for assert_allowed 2017-05-22 15:49:38 -04:00
Mike McLean
dd87bd39e3 scm unit test, partial 2017-05-22 15:49:38 -04:00