Beispiel #1
0
 def test_user_link_http(self):
     self.assertEqual(
         PARSER.parse('$paid [u/johndoe](http://www.reddit.com/u/johndoe) 1'),
         ['johndoe', money.Money(100, 'USD')]
     )
Beispiel #2
0
 def test_user_link_noncanonical_expanded(self):
     self.assertEqual(
         PARSER.parse('$paid [/u/johndoe](https://reddit.com/user/johndoe) 1'),
         ['johndoe', money.Money(100, 'USD')]
     )
Beispiel #3
0
 def test_user_hyphen_link_expanded(self):
     self.assertEqual(
         PARSER.parse('$paid [/u/john-doe](https://www.reddit.com/user/john-doe) 1'),
         ['john-doe', money.Money(100, 'USD')]
     )
Beispiel #4
0
 def test_user_link_expanded_trailing_slash(self):
     self.assertEqual(
         PARSER.parse('$paid [/u/johndoe](https://www.reddit.com/user/johndoe/) 1'),
         ['johndoe', money.Money(100, 'USD')]
     )
Beispiel #5
0
 def test_user_missing_leading_slash(self):
     self.assertEqual(
         PARSER.parse('$paid u/johndoe 1'),
         ['johndoe', money.Money(100, 'USD')]
     )
Beispiel #6
0
 def test_underscores_and_hyphens_allowed_username(self):
     self.assertEqual(
         PARSER.parse('$paid u/Foo_The-Bar $37'),
         ['Foo_The-Bar', money.Money(3700, 'USD')]
     )
Beispiel #7
0
 def test_hyphenated_username(self):
     self.assertEqual(
         PARSER.parse('$paid u/Do-Re-Me $250'),
         ['Do-Re-Me', money.Money(25000, 'USD')]
     )
Beispiel #8
0
 def test_simple(self):
     self.assertEqual(
         PARSER.parse('$paid /u/johndoe 15'),
         ['johndoe', money.Money(1500, 'USD')]
     )
Beispiel #9
0
 def test_user_link_noncanonical_no_leading_slash(self):
     self.assertEqual(
         PARSER.parse('$paid [u/johndoe](https://reddit.com/u/johndoe) 1'),
         ['johndoe', money.Money(100, 'USD')]
     )