Skip to content

Instantly share code, notes, and snippets.

R1#sh run int fa0/0
Building configuration...
Current configuration : 192 bytes
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
standby 1 ip 192.168.1.1
standby 1 priority 105
R1#sh standby
FastEthernet0/0 - Group 1
State is Active
2 state changes, last state change 00:02:43
Virtual IP address is 192.168.1.1
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.052 secs
Preemption enabled
R1(config)#interface f0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#vrrp 123 ip 10.1.1.100
R1(config-if)#vrrp 123 preempt
R2(config)#interface f0/0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#vrrp 123 ip 10.1.1.100
R2(config-if)#vrpp 123 priority 90
R1#show vrrp brief
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa0/0 123 100 3609 Y Master 10.1.1.1 10.1.1.100
R2#show vrrp brief
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa0/0 123 90 3648 Y Backup 10.1.1.1 10.1.1.100
import unittest # importing standard unittest module from python library
class TddPython(unittest.TestCase): # our class that would contain multiple test cases
def test_calc_subtract_method(self): # test method
calc = Calculator() # initiliate the Calculator
result = calc.subtract(4,1)
self.assertEqual(3, result)
if __name__ == '__main__':
import unittest # importing standard unittest module from python library
from testapp.calculator import Calculator # import
class TddPython(unittest.TestCase): # our class that would contain multiple test cases
def test_calc_subtract_method(self): # test method
calc = Calculator() # initiliate the Calculator
result = calc.subtract(4,1)
self.assertEqual(3, result)
calculator.py
class Calculator(object):
def subtract(self, x, y):
pass
class Calculator(object):
def subtract(self, x, y):
return x-y