Skip to content

Commit

Permalink
Cleanup mock config (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
andresp authored Oct 13, 2023
1 parent 9d5c41b commit 1040aa5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 77 deletions.
17 changes: 17 additions & 0 deletions tests/mocks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
config = {
'Database': {
'Bucket': 'testBucket',
'Org': 'org',
'Host': 'localhost',
'Port': '443',
'UseTls': True,
'Token': 'token'
},
'General': {
'HostTimezone': 'Pacific/Los_Angeles'
},
'Modem': {
'Host': '10.0.0.1',
'LogTimezone': 'Pacific/Los_Angeles'
}
}
21 changes: 2 additions & 19 deletions tests/test_motorolamb8600m.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@
from docsismodem.modems.observablemodem import ObservableModem
from docsismodem.modems.observablemodemfactory import ObservableModemFactory

from tests.mocks import config

class TestMotorolaMB8600:

mockConfig = {
'Database': {
'Bucket': 'testBucket',
'Org': 'org',
'Host': 'localhost',
'Port': '443',
'UseTls': True,
'Token': 'token'
},
'General': {
'HostTimezone': 'Pacific/Los_Angeles'
},
'Modem': {
'Host': '10.0.0.1',
'LogTimezone': 'Pacific/Los_Angeles'
}
}

def test_init(self):

instance = ObservableModemFactory.get("MotorolaMB8600", self.mockConfig, logging.getLogger(None))
instance = ObservableModemFactory.get("MotorolaMB8600", config, logging.getLogger(None))
assert isinstance(instance, ObservableModem)
assert type(instance) is MotorolaMB8600

21 changes: 2 additions & 19 deletions tests/test_netgearcm2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@
from docsismodem.modems.observablemodem import ObservableModem
from docsismodem.modems.observablemodemfactory import ObservableModemFactory

from tests.mocks import config

class TestNetgear2000:

mockConfig = {
'Database': {
'Bucket': 'testBucket',
'Org': 'org',
'Host': 'localhost',
'Port': '443',
'UseTls': True,
'Token': 'token'
},
'General': {
'HostTimezone': 'Pacific/Los_Angeles'
},
'Modem': {
'Host': '10.0.0.1',
'LogTimezone': 'Pacific/Los_Angeles'
}
}

def test_init(self):

instance = ObservableModemFactory.get("NetgearCM2000", self.mockConfig, logging.getLogger(None))
instance = ObservableModemFactory.get("NetgearCM2000", config, logging.getLogger(None))
assert isinstance(instance, ObservableModem)
assert type(instance) is NetgearCM2000

21 changes: 2 additions & 19 deletions tests/test_technicolorxb7.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@
from docsismodem.modems.observablemodemfactory import ObservableModemFactory
from docsismodem.modems.technicolor_xb7 import TechnicolorXB7

from tests.mocks import config

class TestTechnicolorXB7:

mockConfig = {
'Database': {
'Bucket': 'testBucket',
'Org': 'org',
'Host': 'localhost',
'Port': '443',
'UseTls': True,
'Token': 'token'
},
'General': {
'HostTimezone': 'Pacific/Los_Angeles'
},
'Modem': {
'Host': '10.0.0.1',
'LogTimezone': 'Pacific/Los_Angeles'
}
}

def test_init(self):

instance = ObservableModemFactory.get("TechnicolorXB7", self.mockConfig, logging.getLogger(None))
instance = ObservableModemFactory.get("TechnicolorXB7", config, logging.getLogger(None))
assert isinstance(instance, ObservableModem)
assert type(instance) is TechnicolorXB7

23 changes: 3 additions & 20 deletions tests/test_touchstonetg3492upcch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@
from docsismodem.modems.observablemodemfactory import ObservableModemFactory
from docsismodem.modems.touchstone_tg3492_upc_ch import TouchstoneTG3492UPCCH

from tests.mocks import config

class TestTouchstoneTG3492UPCCH:

mockConfig = {
'Database': {
'Bucket': 'testBucket',
'Org': 'org',
'Host': 'localhost',
'Port': '443',
'UseTls': True,
'Token': 'token'
},
'General': {
'HostTimezone': 'Pacific/Los_Angeles'
},
'Modem': {
'Host': '10.0.0.1',
'LogTimezone': 'Pacific/Los_Angeles'
}
}


def test_init(self):

instance = ObservableModemFactory.get("TouchstoneTG3492UPCCH", self.mockConfig, logging.getLogger(None))
instance = ObservableModemFactory.get("TouchstoneTG3492UPCCH", config, logging.getLogger(None))
assert isinstance(instance, ObservableModem)
assert type(instance) is TouchstoneTG3492UPCCH

0 comments on commit 1040aa5

Please sign in to comment.