Skip to content

Commit

Permalink
Updated main.py tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cjerrington committed May 12, 2020
1 parent 64500de commit d2ceacf
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions tests/main.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
import netutils
import netutil

test = PortCheck("google.com", 443)
test2 = PortCheck("google.com", 25)
print(f"Version: {netutil.__version__}")

facebook = PortCheck("facebook.com", 443)
website = PortCheck("claytonerrington.com", 443)
google = netutil.PortCheck("google.com", 443)
google2 = netutil.PortCheck("google.com", 123)

facebook = netutil.PortCheck("facebook.com", 443)
website = netutil.PortCheck("claytonerrington.com", 443)

local = netutil.PortCheck("127.0.0.1", 85)


# Getting basic Information
print(f"Your hostname is: {host_name}")
print(f"Your local IP is: {host_ip}")
print(f"Your hostname is: {netutil.host_name}")
print(f"Your local IP is: {netutil.host_ip}")

# Different testing
print(f"Testing {test.domain}:{test.port}... ")
if(test.isOpen()):
print(f" {test.domain}:{test.port} is Open!")

print(f"Testing {google.domain}... ")
if(google.isOpen()):
print(f" {google.domain}:{google.port} is Open!")
else:
print(f" {test.domain}:{test.port} is Closed!")
print(f" {google.domain}:{google.port} is Closed!")

print(f"Testing {test2.domain}:{test2.port}... ")
if(test2.isOpen()):
print(f" {test2.domain}:{test2.port} is Open!")

print(f"Testing {google2.domain}:{google2.port}... ")
if(google2.isOpen()):
print(f" {google2.domain}:{google2.port} is Open!")
else:
print(f" {test2.domain}:{test2.port} is Closed!")
print(f" {google2.domain}:{google2.port} is Closed!")

print(f"Testing {facebook.domain}:{facebook.port}... {facebook.isOpen()}")
print(f"Testing {website.domain}:{website.port}... {website.isOpen()}")

print(local.isOpen())

0 comments on commit d2ceacf

Please sign in to comment.