summaryrefslogtreecommitdiff
path: root/tests/test_scripts/test_common.py
blob: 60741db9260f37c3bdb4fdc51459b471ec9fd7ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import unittest

class TestParseVars(unittest.TestCase):
    def test_parse_vars_good(self):
        from pyramid.scripts.common import parse_vars
        vars = ['a=1', 'b=2']
        result = parse_vars(vars)
        self.assertEqual(result, {'a': '1', 'b': '2'})

    def test_parse_vars_bad(self):
        from pyramid.scripts.common import parse_vars
        vars = ['a']
        self.assertRaises(ValueError, parse_vars, vars)