Skip to content

Commit b0ee88f

Browse files
committed
Modified the test cases for partiate domain method
1 parent 2317cae commit b0ee88f

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

dnsgen/test_dnsgen.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
11

22
import unittest
3-
import tldextract
4-
53
import dnsgen
64

7-
8-
# domain = "....."
9-
# domain = ".?@#3.fde!.@.qweqw"
10-
# domain = "1.?@#3.fde!.@.qweqw"
11-
# domain = "www.letter.com.cn"
12-
13-
# def partiate_domain(domain):
14-
# '''
15-
# Split domain base on subdomain levels.
16-
# TLD is taken as one part, regardless of its levels (.co.uk, .com, ...)
17-
# '''
18-
19-
# # test.1.foo.example.com -> [test, 1, foo, example, com]
20-
# # test.2.foo.example.com.cn -> [test, 2, foo, example, com.cn]
21-
# # test.example.co.uk -> [test, example, co.uk]
22-
23-
# ext = tldextract.extract(domain.lower())
24-
# parts = (ext.subdomain.split('.') + [ext.domain, ext.suffix])
25-
26-
# return [p for p in parts if p]
27-
28-
# print(partiate_domain(domain))
29-
30-
315
class Test_PartiateDomain(unittest.TestCase):
326
def test_generalDomains(self):
337
self.assertEqual(dnsgen.partiate_domain("test.1.foo.example.com"),['test', '1', 'foo', 'example', 'com'])

0 commit comments

Comments
 (0)