Created
February 7, 2019 08:45
-
-
Save radxene/8b62b1cef73b5e2e032e4597a5acdede to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from src.proxy import ManipStr | |
class TestManipStr(unittest.TestCase): | |
def setUp(self): | |
self.manip = ManipStr() | |
def test_rm_host_habra(self): | |
u1 = 'http://habrahabr.ru/company/dsec/blog/258457/' | |
u2 = 'https://moikrug.ru/vacancies' | |
self.assertEqual(self.manip.rm_host_habra(u1), '/company/dsec/blog/258457/') | |
self.assertEqual(self.manip.rm_host_habra(u2), u2) | |
def test_mark_tm(self): | |
w1 = 'python' | |
w2 = 'python,' | |
w3 = 'python!' | |
self.assertEqual(self.manip.mark_tm(w1), 'python™') | |
self.assertEqual(self.manip.mark_tm(w2), 'python™,') | |
self.assertEqual(self.manip.mark_tm(w3), 'python™!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment