forked from python-ivi/python-vxi11
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from loft-orbital/fix/deprecation-warnings
fix: address deprecation warnings
- Loading branch information
Showing
2 changed files
with
30 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,46 @@ | ||
#!/usr/bin/env python | ||
|
||
import nose | ||
from nose.tools import eq_ | ||
from vxi11.vxi11 import parse_visa_resource_string | ||
|
||
|
||
def test_parse_visa_resource_string(): | ||
f = parse_visa_resource_string | ||
|
||
res = f('TCPIP::10.0.0.1::INSTR') | ||
eq_(res['type'], 'TCPIP') | ||
eq_(res['prefix'], 'TCPIP') | ||
eq_(res['arg1'], '10.0.0.1') | ||
eq_(res['suffix'], 'INSTR') | ||
assert res['type'] == 'TCPIP' | ||
assert res['prefix'] == 'TCPIP' | ||
assert res['arg1'] == '10.0.0.1' | ||
assert res['suffix'] == 'INSTR' | ||
|
||
res = f('TCPIP0::10.0.0.1::INSTR') | ||
eq_(res['type'], 'TCPIP') | ||
eq_(res['prefix'], 'TCPIP0') | ||
eq_(res['arg1'], '10.0.0.1') | ||
eq_(res['suffix'], 'INSTR') | ||
assert res['type'] == 'TCPIP' | ||
assert res['prefix'] == 'TCPIP0' | ||
assert res['arg1'] == '10.0.0.1' | ||
assert res['suffix'] == 'INSTR' | ||
|
||
res = f('TCPIP::10.0.0.1::gpib,5::INSTR') | ||
eq_(res['type'], 'TCPIP') | ||
eq_(res['prefix'], 'TCPIP') | ||
eq_(res['arg1'], '10.0.0.1') | ||
eq_(res['suffix'], 'INSTR') | ||
assert res['type'] == 'TCPIP' | ||
assert res['prefix'] == 'TCPIP' | ||
assert res['arg1'] == '10.0.0.1' | ||
assert res['suffix'] == 'INSTR' | ||
|
||
res = f('TCPIP0::10.0.0.1::gpib,5::INSTR') | ||
eq_(res['type'], 'TCPIP') | ||
eq_(res['prefix'], 'TCPIP0') | ||
eq_(res['arg1'], '10.0.0.1') | ||
eq_(res['arg2'], 'gpib,5') | ||
eq_(res['suffix'], 'INSTR') | ||
assert res['type'] == 'TCPIP' | ||
assert res['prefix'] == 'TCPIP0' | ||
assert res['arg1'] == '10.0.0.1' | ||
assert res['arg2'] == 'gpib,5' | ||
assert res['suffix'] == 'INSTR' | ||
|
||
res = f('TCPIP0::10.0.0.1::usb0::INSTR') | ||
eq_(res['type'], 'TCPIP') | ||
eq_(res['prefix'], 'TCPIP0') | ||
eq_(res['arg1'], '10.0.0.1') | ||
eq_(res['arg2'], 'usb0') | ||
eq_(res['suffix'], 'INSTR') | ||
assert res['type'] == 'TCPIP' | ||
assert res['prefix'] == 'TCPIP0' | ||
assert res['arg1'] == '10.0.0.1' | ||
assert res['arg2'] == 'usb0' | ||
assert res['suffix'] == 'INSTR' | ||
|
||
res = f('TCPIP0::10.0.0.1::usb0[1234::5678::MYSERIAL::0]::INSTR') | ||
eq_(res['type'], 'TCPIP') | ||
eq_(res['prefix'], 'TCPIP0') | ||
eq_(res['arg1'], '10.0.0.1') | ||
eq_(res['arg2'], 'usb0[1234::5678::MYSERIAL::0]') | ||
eq_(res['suffix'], 'INSTR') | ||
|
||
assert res['type'] == 'TCPIP' | ||
assert res['prefix'] == 'TCPIP0' | ||
assert res['arg1'] == '10.0.0.1' | ||
assert res['arg2'] == 'usb0[1234::5678::MYSERIAL::0]' | ||
assert res['suffix'] == 'INSTR' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters