1- import frontend as ft
1+ import sillysimple as ss
22import ulid
33from pathlib import Path
44import pytest
@@ -21,58 +21,58 @@ def cleanup():
2121
2222
2323def test_load_comments ():
24- comments = ft .get_comments_for_slug ("example" , ["." ,])
24+ comments = ss .get_comments_for_slug ("example" , ["." ,])
2525 assert len (comments ) == 1
2626
2727def test_create_comment (file_cleanup ):
28- comments = ft .get_comments_for_slug ("example" , ["." ,])
28+ comments = ss .get_comments_for_slug ("example" , ["." ,])
2929
3030 comment_fname = str (ulid .new ())
31- c = ft .Comment ()
31+ c = ss .Comment ()
3232 c .created_by = "Leon"
3333 c .created_by_contact = "leon@gmail.com"
3434 c .paragraphs = "Do you dream, Elliot?"
3535
3636 path = c .dump_into_file (["example" ,], comment_fname )
3737 file_cleanup .append (path )
3838
39- comments = ft .get_comments_for_slug ("example" , ["." ,])
39+ comments = ss .get_comments_for_slug ("example" , ["." ,])
4040
4141 assert comments [1 ].created_by == "Leon"
4242 assert len (comments ) == 2
4343
4444def test_comment_api_from_path ():
4545 p = Path ("comments" , "example" , "01H7A86Y8EM4DM3FM25EWPHB8W.txt" )
46- c = ft .Comment .from_path (p )
46+ c = ss .Comment .from_path (p )
4747 #print(c)
4848
4949 assert len (c .paragraphs ) == 3
5050
5151def test_comment_api_into_file_author_fail ():
5252 comment_fname = str (ulid .new ())
5353
54- comment = ft .Comment ()
54+ comment = ss .Comment ()
5555 comment .created_by_contact = "leon@gmail.com"
5656 comment .paragraphs = ["Do you dream, Elliot?" , "You scraping so hard..." ]
5757
5858 assert comment .dump_into_file (["example" ,], comment_fname ) is None
5959
60- comments = ft .get_comments_for_slug ("example" , ["." ,])
60+ comments = ss .get_comments_for_slug ("example" , ["." ,])
6161
6262def test_comment_api_into_file (file_cleanup ):
63- comments = ft .get_comments_for_slug ("example" , ["." ,])
63+ comments = ss .get_comments_for_slug ("example" , ["." ,])
6464
6565 comment_fname = str (ulid .new ())
6666
67- comment = ft .Comment ()
67+ comment = ss .Comment ()
6868 comment .created_by = "Elliot"
6969 comment .created_by_contact = "elliot@protonmail.com"
7070 comment .paragraphs = ["How do I know which one's for me?" ,]
7171
7272 result_path = comment .dump_into_file (["example" ,], comment_fname )
7373 file_cleanup .append (result_path )
7474
75- comments = ft .get_comments_for_slug ("example" , ["." ,])
75+ comments = ss .get_comments_for_slug ("example" , ["." ,])
7676
7777 assert len (comments [- 1 ].paragraphs ) == 1
7878 assert comments [- 1 ].created_by == "Elliot"
0 commit comments