use same arch parsing for cli and hub
Related: https://pagure.io/koji/issue/1237
This commit is contained in:
parent
8529708b7c
commit
558e129c6b
6 changed files with 74 additions and 66 deletions
31
tests/test_lib/test_parse_arches.py
Normal file
31
tests/test_lib/test_parse_arches.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# coding: utf-8
|
||||
from __future__ import absolute_import
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import koji
|
||||
|
||||
class TestParseArchesString(unittest.TestCase):
|
||||
def test_parse_valid_arches(self):
|
||||
r = koji.parse_arches('i386', to_list=True)
|
||||
self.assertEqual(['i386'], r)
|
||||
|
||||
r = koji.parse_arches('i386 x86_64', to_list=True)
|
||||
self.assertEqual(['i386', 'x86_64'], r)
|
||||
|
||||
r = koji.parse_arches('i386 x86_64 ', to_list=True)
|
||||
self.assertEqual(['i386', 'x86_64'], r)
|
||||
|
||||
r = koji.parse_arches('i386,x86_64', to_list=True)
|
||||
self.assertEqual(['i386', 'x86_64'], r)
|
||||
|
||||
def test_parse_invalid_arches(self):
|
||||
with self.assertRaises(koji.GenericError):
|
||||
koji.parse_arches(u'ěšč')
|
||||
|
||||
with self.assertRaises(koji.GenericError):
|
||||
koji.parse_arches(u'i386;x86_64')
|
||||
|
||||
with self.assertRaises(koji.GenericError):
|
||||
koji.parse_arches(u'i386,x86_64', strict=True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue