import sys, argparse
sys.path.append('/home/andy/src/pypeer/lib')
sys.path.append('/Users/andy/src/pypeer/lib')

from pypeer.ConfigDictionary import ConfigDictionary

def test_username():
	config = ConfigDictionary('/Users/andy/src/pypeer/etc/example.ini')
	thisusername = config.username()
	assert thisusername == 'exampleuser' 

def test_can_find_rtr1():
	config = ConfigDictionary('/Users/andy/src/pypeer/etc/example.ini')
	assert config.get_router_ip('rtr1') == '91.194.69.4'
@@ -14,16 +14,47 @@
 rgparse%0A
+from jnpr.junos import Device%0A%0A
 sys.path
@@ -136,17 +136,16 @@
 r/lib')%0A
-%0A
 from pyp
@@ -449,16 +449,16 @@
 e.ini')%0A
-
 %09assert 
@@ -502,8 +502,417 @@
 94.69.4'
+%0A%0Adef test_can_login_parse_serial():%0A%09config = ConfigDictionary('/Users/andy/src/pypeer/etc/example.ini')%0A%09jdev = Device(user=config.username(), host=config.get_router_ip('rtr1'), password=config.password())%0A%09jdev.open(gather_facts=False)%0A%09inv = jdev.rpc.get_chassis_inventory()%0A%09print %22model: %25s%22 %25 inv.findtext('.//chassis/description')%0A%09jdev.close()%0A%09assert inv.findtext('.//chassis/description') == 'VMX'%0A

test can log into virtual router