summaryrefslogtreecommitdiff
path: root/tests/test_scripts/test_common.py
blob: e286d3c3ea5412bd481fe57c5a34d9fe4d06b19b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)