24 lines
No EOL
933 B
Python
24 lines
No EOL
933 B
Python
import unittest
|
|
from trustcafeapiwrapper.utils.get_child_spksk_from_paths import get_child_spksk_from_paths
|
|
class TestGetChildSpkskFromPaths(unittest.TestCase):
|
|
def test_post_reaction(self):
|
|
parent_path = '/user/johndoe'
|
|
item_path = '/post/12345'
|
|
expected_output = {
|
|
"pk": "userprofile#johndoe",
|
|
"sk": "post#12345",
|
|
"entity": "post",
|
|
"slug": "12345"
|
|
}
|
|
self.assertEqual(get_child_spksk_from_paths(parent_path, item_path), expected_output)
|
|
|
|
def test_comment_reaction(self):
|
|
parent_path = '/post/12345-abcv'
|
|
item_path = '/comment/67890'
|
|
expected_output = {
|
|
"pk": "post#12345-abcv",
|
|
"sk": "comment#67890",
|
|
"entity": "comment",
|
|
"slug": "67890"
|
|
}
|
|
self.assertEqual(get_child_spksk_from_paths(parent_path, item_path), expected_output) |