<s> __author__ = "<STR_LIT>" <EOL> __credits__ = "<STR_LIT>" <EOL> import unittest <EOL> from nose . plugins . attrib import attr <EOL> from jnpr . junos import Device <EOL> from jnpr . junos . utils . util import Util <EOL> from mock import patch <EOL> @ attr ( '<STR_LIT>' ) <EOL> class TestUtil ( unittest . TestCase ) : <EOL> @ patch ( '<STR_LIT>' ) <EOL> def setUp ( self , mock_connect ) : <EOL> self . dev = Device ( host = '<STR_LIT>' , user = '<STR_LIT>' , password = '<STR_LIT>' , <EOL> gather_facts = False ) <EOL> self . dev . open ( ) <EOL> self . util = Util ( self . dev ) <EOL> def test_repr ( self ) : <EOL> self . assertEqual ( repr ( self . util ) , '<STR_LIT>' ) <EOL> def test_dev_setter_exception ( self ) : <EOL> def mod_dev ( ) : <EOL> self . util . dev = '<STR_LIT:abc>' <EOL> self . assertRaises ( RuntimeError , mod_dev ) <EOL> def test_rpc_setter_exception ( self ) : <EOL> def mod_rpc ( ) : <EOL> self . util . rpc = '<STR_LIT:abc>' <EOL> self . assertRaises ( RuntimeError , mod_rpc ) </s>
