Oz N Tiram 9 rokov pred
rodič
commit
b1588b72b0
1 zmenil súbory, kde vykonal 9 pridanie a 2 odobranie
  1. 9 2
      tests/test_all.py

+ 9 - 2
tests/test_all.py

@@ -111,12 +111,19 @@ def test_tags():
     assert len(t) == 4
     assert t[0].name == u'buf'
 
-    new_tag = Tag('bug')
+    new_tag = Tag('buggg')
     new_tag.posts = [100,100]
     with pytest.raises(ValueError):
         new_tag.posts = "This should not work"
     with pytest.raises(ValueError):
         new_tag.posts = 1  # This should not either
 
-#os.unlink(DB._db._storage._handle.name)
+def test_slug():
+
+    t = Tag('foo:bar')
+    assert t.slug == "foo-bar"
+    t = Tag('foo:;bar,.,baz')
+    assert t.slug == "foo-bar-baz"
+
+os.unlink(DB._db._storage._handle.name)