Skip to content

Commit

Permalink
Extract the domain name from a URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Dec 9, 2024
1 parent 18859f6 commit fc0c10d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions kyu_5/extract_the_domain_name_from_url/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Extract the domain name from a URL."""
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
"""
Extract the domain name from a URL
Extract the domain name from a URL.
Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""


def domain_name(url: str) -> str:
"""
Domain name from URL.
Parses out just the domain name and
returns it as a string.
:param url: URL as a string
:return: domain name as a string
"""
Expand Down
9 changes: 5 additions & 4 deletions kyu_5/extract_the_domain_name_from_url/test_domain_name.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Assert that 'domain_name' function
Assert that 'domain_name' function.
returns domain name from given URL string.
Created by Egor Kostan.
GitHub: https://github.com/ikostan
Expand Down Expand Up @@ -34,12 +35,12 @@
name='Source/Kata')
# pylint: enable-msg=R0801
class DomainNameTestCase(unittest.TestCase):
"""
Testing domain_name function
"""
"""Testing domain_name function."""

def test_domain_name(self):
"""
domain_name function testing.
Assert that 'domain_name' function
returns domain name from given URL string.
:return:
Expand Down

0 comments on commit fc0c10d

Please sign in to comment.