Skip to content

Commit

Permalink
Added unittests for traffic standard
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavNqualisystems committed Feb 12, 2019
1 parent 134f492 commit 8e45ad2
Show file tree
Hide file tree
Showing 8 changed files with 588 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
AVAILABLE_SHELL_TYPES = ['CS_TrafficGeneratorChassis']

__all__ = ["TrafficGeneratorChassis", "GenericTrafficGeneratorModule",
"GenericTrafficGeneratorPort", "GenericPowerPort"]
"GenericTrafficGeneratorPort", "GenericPowerPort", "AVAILABLE_SHELL_TYPES"]


class TrafficGeneratorChassis(AbstractResource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def power_management(self):
"""
return self.attributes.get("{}Power Management".format(self.namespace_prefix), None)

@staticmethod
def from_context(shell_name, supported_os, context):
@classmethod
def from_context(cls, shell_name, supported_os, context):
"""
Creates an instance of Networking Resource by given context
:param shell_name: Shell Name
Expand All @@ -92,11 +92,10 @@ def from_context(shell_name, supported_os, context):
:rtype GenericNetworkingResource
"""

result = GenericTrafficChassisResource(shell_name=shell_name, name=context.resource.name, supported_os=supported_os)
result = cls(shell_name=shell_name, name=context.resource.name, supported_os=supported_os)
result.address = context.resource.address
result.family = context.resource.family
result.fullname = context.resource.fullname

result.attributes = dict(context.resource.attributes)

return result
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def service_categories(self):
"""
return self.attributes.get("{}Service Categories".format(self.namespace_prefix), None)

@staticmethod
def from_context(shell_name, supported_os, context):
@classmethod
def from_context(cls, shell_name, supported_os, context):
"""
Creates an instance of Networking Resource by given context
:param shell_name: Shell Name
Expand All @@ -99,8 +99,8 @@ def from_context(shell_name, supported_os, context):
:rtype GenericNetworkingResource
"""

result = GenericTrafficControllerResource(shell_name=shell_name, name=context.resource.name,
supported_os=supported_os)
result = cls(shell_name=shell_name, name=context.resource.name,
supported_os=supported_os)
result.address = context.resource.address
result.family = context.resource.family
result.fullname = context.resource.fullname
Expand Down
Empty file.

0 comments on commit 8e45ad2

Please sign in to comment.