Skip to content

Instantly share code, notes, and snippets.

@radxene
Created February 7, 2019 08:45
Show Gist options
  • Save radxene/8b62b1cef73b5e2e032e4597a5acdede to your computer and use it in GitHub Desktop.
Save radxene/8b62b1cef73b5e2e032e4597a5acdede to your computer and use it in GitHub Desktop.
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