aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_section.py
diff options
context:
space:
mode:
authorSean Brant2013-03-09 15:57:26 -0600
committerSean Brant2013-03-09 15:57:26 -0600
commitfa90f078e5de5a1acbd9eda529db17ab1b2b4cb3 (patch)
tree7d3014b692f53e5272c52a7f87c66f5aa9908b44 /tests/test_section.py
downloadpykss-fa90f078e5de5a1acbd9eda529db17ab1b2b4cb3.tar.bz2
Initial Import
Diffstat (limited to 'tests/test_section.py')
-rw-r--r--tests/test_section.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_section.py b/tests/test_section.py
new file mode 100644
index 0000000..7ba8496
--- /dev/null
+++ b/tests/test_section.py
@@ -0,0 +1,36 @@
+import unittest
+
+from pykss.section import Section
+
+
+class SectionTestCase(unittest.TestCase):
+
+ def setUp(self):
+ comment = """
+# Form Button
+
+Your standard form button.
+
+:hover - Highlights when hovering.
+:disabled - Dims the button when disabled.
+.primary - Indicates button is the primary action.
+.smaller - A smaller button
+
+Styleguide 2.1.1.
+ """
+ self.section = Section(comment.strip(), 'example.css')
+
+ def test_parses_the_description(self):
+ self.assertEqual(self.section.description, '# Form Button\n\nYour standard form button.')
+
+ def test_parses_the_modifiers(self):
+ self.assertEqual(len(self.section.modifiers), 4)
+
+ def test_parses_modifier_names(self):
+ self.assertEqual(self.section.modifiers[0].name, ':hover')
+
+ def test_parses_modifier_descriptions(self):
+ self.assertEqual(self.section.modifiers[0].description, 'Highlights when hovering.')
+
+ def test_parses_the_styleguide_reference(self):
+ self.assertEqual(self.section.section, '2.1.1')