changed the mock data naming of files removed :
This commit is contained in:
1 parent
43e7040500
commit
fdcb289e6e
2 files changed
+3
-4
No files matched your search
@@ -20,7 +20,6 @@ from pyFG.fortios import FortiConfig
|
|||||||
|
|
||||||
|
|
||||||
class TestConfigFortiOSDriver(unittest.TestCase, TestConfigNetworkDriver):
|
class TestConfigFortiOSDriver(unittest.TestCase, TestConfigNetworkDriver):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
hostname = '192.168.76.13'
|
hostname = '192.168.76.13'
|
||||||
@@ -33,7 +32,6 @@ class TestConfigFortiOSDriver(unittest.TestCase, TestConfigNetworkDriver):
|
|||||||
|
|
||||||
|
|
||||||
class TestGetterFortiOSDriver(unittest.TestCase, TestGettersNetworkDriver):
|
class TestGetterFortiOSDriver(unittest.TestCase, TestGettersNetworkDriver):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.mock = True
|
cls.mock = True
|
||||||
@@ -58,9 +56,10 @@ class FakeFortiOSDevice:
|
|||||||
return data_file.read().splitlines()
|
return data_file.read().splitlines()
|
||||||
|
|
||||||
def execute_command(self, command):
|
def execute_command(self, command):
|
||||||
return self.read_txt_file('fortios/mock_data/{}.txt'.format(command.replace(' ', '_').replace('|', '')))
|
return self.read_txt_file(
|
||||||
|
'fortios/mock_data/{}.txt'.format(command.replace(' ', '_').replace('|', '').replace(':', '')))
|
||||||
|
|
||||||
def load_config(self, config_block):
|
def load_config(self, config_block):
|
||||||
self.running_config = FortiConfig('running')
|
self.running_config = FortiConfig('running')
|
||||||
self.running_config.parse_config_output(self.read_txt_file('fortios/mock_data/{}.txt'.format(
|
self.running_config.parse_config_output(self.read_txt_file('fortios/mock_data/{}.txt'.format(
|
||||||
config_block.replace(' ', '_'))))
|
config_block.replace(' ', '_'))))
|
||||||
Reference in new issue
Block a user