Skip to content

Commit d9c86ac

Browse files
Fix unit tests
* Fix unit tests * Rename `tests` directory to `test`
1 parent 5ffd082 commit d9c86ac

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed
File renamed without changes.

test/test_utils.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import unittest
2+
3+
from cloudinary_cli.utils.utils import parse_option_value
4+
5+
6+
class UtilsTest(unittest.TestCase):
7+
def test_parse_option_value(self):
8+
""" should parse option values correctly """
9+
self.assertEqual("haha,123,1234", parse_option_value("haha,123,1234"))
10+
self.assertTrue(parse_option_value("True"))
11+
self.assertFalse(parse_option_value("false"))
12+
self.assertListEqual(["test", "123"], parse_option_value('["test","123"]'))
13+
self.assertDictEqual({"foo": "bar"}, parse_option_value('{"foo":"bar"}'))
14+
self.assertDictEqual({"an": "object", "or": "dict"}, parse_option_value('{"an":"object","or":"dict"}'))
15+
self.assertListEqual(["this", "will", "be", "read", "as",
16+
"a", "list"], parse_option_value('["this","will","be","read","as","a","list"]'))
17+
18+
def test_parse_option_value_converts_int_to_str(self):
19+
""" should convert a parsed int to a str """
20+
self.assertEqual("1", parse_option_value(1))

tests/test_utils.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)