mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
PEP 8 clean thanks to auto pep8
This commit is contained in:
1 parent
7f185663d1
commit
f5ed9fbcf1
124 files changed
+340
-210
No files matched your search
@@ -89,7 +89,7 @@ def test_iomem(router_c1700):
|
||||
|
||||
def test_mac_addr(router_c1700):
|
||||
|
||||
assert router_c1700.mac_addr != None
|
||||
assert router_c1700.mac_addr is not None
|
||||
router_c1700.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c1700.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ def test_iomem(router_c2600):
|
||||
|
||||
def test_mac_addr(router_c2600):
|
||||
|
||||
assert router_c2600.mac_addr != None
|
||||
assert router_c2600.mac_addr is not None
|
||||
router_c2600.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c2600.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def test_iomem(router_c2691):
|
||||
|
||||
def test_mac_addr(router_c2691):
|
||||
|
||||
assert router_c2691.mac_addr != None
|
||||
assert router_c2691.mac_addr is not None
|
||||
router_c2691.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c2691.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ def test_iomem(router_c3600):
|
||||
|
||||
def test_mac_addr(router_c3600):
|
||||
|
||||
assert router_c3600.mac_addr != None
|
||||
assert router_c3600.mac_addr is not None
|
||||
router_c3600.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c3600.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def test_iomem(router_c3725):
|
||||
|
||||
def test_mac_addr(router_c3725):
|
||||
|
||||
assert router_c3725.mac_addr != None
|
||||
assert router_c3725.mac_addr is not None
|
||||
router_c3725.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c3725.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def test_iomem(router_c3745):
|
||||
|
||||
def test_mac_addr(router_c3745):
|
||||
|
||||
assert router_c3745.mac_addr != None
|
||||
assert router_c3745.mac_addr is not None
|
||||
router_c3745.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c3745.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ def test_power_supplies(router_c7200):
|
||||
|
||||
def test_mac_addr(router_c7200):
|
||||
|
||||
assert router_c7200.mac_addr != None
|
||||
assert router_c7200.mac_addr is not None
|
||||
router_c7200.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router_c7200.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
@@ -162,7 +162,7 @@ def test_slot_remove_adapter(router_c7200):
|
||||
adapter = PA_FE_TX()
|
||||
router_c7200.slot_add_binding(1, adapter)
|
||||
router_c7200.slot_remove_binding(1)
|
||||
assert router_c7200.slots[1] == None
|
||||
assert router_c7200.slots[1] is None
|
||||
|
||||
|
||||
def test_slot_add_remove_nio_binding(router_c7200):
|
||||
|
||||
@@ -11,7 +11,7 @@ def hypervisor_manager(request):
|
||||
print("\nStarting Dynamips Hypervisor: {}".format(dynamips_path))
|
||||
manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1")
|
||||
|
||||
#manager.start_new_hypervisor()
|
||||
# manager.start_new_hypervisor()
|
||||
|
||||
def stop():
|
||||
print("\nStopping Dynamips Hypervisor")
|
||||
|
||||
@@ -133,7 +133,7 @@ def test_reset_stats(hypervisor):
|
||||
def test_set_bandwidth(hypervisor):
|
||||
|
||||
nio = NIO_Null(hypervisor)
|
||||
assert nio.bandwidth == None # no constraint by default
|
||||
assert nio.bandwidth is None # no constraint by default
|
||||
nio.set_bandwidth(1000) # bandwidth = 1000 Kb/s
|
||||
assert nio.bandwidth == 1000
|
||||
nio.delete()
|
||||
@@ -99,14 +99,14 @@ def test_nvram(router):
|
||||
|
||||
def test_mmap(router):
|
||||
|
||||
assert router.mmap == True # default value
|
||||
assert router.mmap # default value
|
||||
router.mmap = False
|
||||
assert router.mmap == False
|
||||
|
||||
|
||||
def test_sparsemem(router):
|
||||
|
||||
assert router.sparsemem == True # default value
|
||||
assert router.sparsemem # default value
|
||||
router.sparsemem = False
|
||||
assert router.sparsemem == False
|
||||
|
||||
@@ -209,7 +209,7 @@ def test_get_slot_nio_bindings(router):
|
||||
|
||||
def test_mac_addr(router):
|
||||
|
||||
assert router.mac_addr != None
|
||||
assert router.mac_addr is not None
|
||||
router.mac_addr = "aa:aa:aa:aa:aa:aa"
|
||||
assert router.mac_addr == "aa:aa:aa:aa:aa:aa"
|
||||
|
||||
|
||||
@@ -8,56 +8,56 @@ import tempfile
|
||||
|
||||
|
||||
# class TestVMHandler(AsyncHTTPTestCase):
|
||||
#
|
||||
#
|
||||
# def setUp(self):
|
||||
#
|
||||
#
|
||||
# AsyncHTTPTestCase.setUp(self)
|
||||
# self.post_request = partial(self.http_client.fetch,
|
||||
# self.get_url("/api/vms/dynamips"),
|
||||
# self.stop,
|
||||
# method="POST")
|
||||
#
|
||||
#
|
||||
# def get_app(self):
|
||||
# return tornado.web.Application(Dynamips().handlers())
|
||||
#
|
||||
#
|
||||
# def test_endpoint(self):
|
||||
# self.http_client.fetch(self.get_url("/api/vms/dynamips"), self.stop)
|
||||
# response = self.wait()
|
||||
# assert response.code == 200
|
||||
#
|
||||
#
|
||||
# def test_upload(self):
|
||||
#
|
||||
#
|
||||
# try:
|
||||
# from poster.encode import multipart_encode
|
||||
# except ImportError:
|
||||
# # poster isn't available for Python 3, let's just ignore the test
|
||||
# return
|
||||
#
|
||||
#
|
||||
# file_to_upload = tempfile.NamedTemporaryFile()
|
||||
# data, headers = multipart_encode({"file1": file_to_upload})
|
||||
# body = ""
|
||||
# for d in data:
|
||||
# body += d
|
||||
#
|
||||
#
|
||||
# response = self.fetch('/api/vms/dynamips/storage/upload',
|
||||
# headers=headers,
|
||||
# body=body,
|
||||
# method='POST')
|
||||
#
|
||||
#
|
||||
# assert response.code == 200
|
||||
#
|
||||
#
|
||||
# def get_new_ioloop(self):
|
||||
# return tornado.ioloop.IOLoop.instance()
|
||||
#
|
||||
#
|
||||
# def test_create_vm(self):
|
||||
#
|
||||
#
|
||||
# post_data = {"name": "R1",
|
||||
# "platform": "c3725",
|
||||
# "console": 2000,
|
||||
# "aux": 3000,
|
||||
# "image": "c3725.bin",
|
||||
# "ram": 128}
|
||||
#
|
||||
#
|
||||
# self.post_request(body=json.dumps(post_data))
|
||||
# response = self.wait()
|
||||
# assert(response.headers['Content-Type'].startswith('application/json'))
|
||||
|
||||
Reference in new issue
Block a user