Ejemplo n.º 1
0
 def test_4_community(self):
     communities = Communities()
     community = to_Community('1:1')
     communities.add(community)
     self.assertEqual(
         communities.pack(), ''.join(
             [chr(c) for c in [0xc0, 0x08, 0x04, 0x00, 0x01, 0x00, 0x01]]))
Ejemplo n.º 2
0
def community (tokeniser):
	communities = Communities()

	value = tokeniser()
	if value == '[':
		while True:
			value = tokeniser()
			if value == ']':
				break
			communities.add(_community(value))
	else:
		communities.add(_community(value))

	return communities
Ejemplo n.º 3
0
def community(tokeniser):
    communities = Communities()

    value = tokeniser()
    if value == '[':
        while True:
            value = tokeniser()
            if value == ']':
                break
            communities.add(_community(value))
    else:
        communities.add(_community(value))

    return communities
Ejemplo n.º 4
0
	def test_4_community (self):
		communities = Communities()
		community = to_Community('1:1')
		communities.add(community)
		self.assertEqual(communities.pack(),''.join([chr(c) for c in [0xc0,0x08,0x04,0x00,0x01,0x00,0x01]]))