コード例 #1
0
 def test_get_oid(self):
     expected = ('1.3.6.1.4.1.8072.3.2.10')
     with patch('puresnmp.api.pythonic.raw') as mck:
         mck.get.return_value = ObjectIdentifier.from_string(
             '1.3.6.1.4.1.8072.3.2.10')
         result = get('::1', 'private', '1.2.3')
     self.assertEqual(result, expected)
コード例 #2
0
 def test_get_string(self):
     expected = (b'Linux d24cf7f36138 4.4.0-28-generic #47-Ubuntu SMP '
                 b'Fri Jun 24 10:09:13 UTC 2016 x86_64')
     with patch('puresnmp.api.pythonic.raw') as mck:
         mck.get.return_value = OctetString(
             b'Linux d24cf7f36138 4.4.0-28-generic #47-Ubuntu SMP '
             b'Fri Jun 24 10:09:13 UTC 2016 x86_64')
         result = get('::1', 'private', '1.2.3')
     self.assertEqual(result, expected)