Skip to content

Commit b6b593c

Browse files
committed
Fix the tests to set the serial on the device
The serial is a property of the device, not the key.
1 parent 6cec258 commit b6b593c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/test_misc.doctest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ True
6464
We can also put device-specific properties in a device:
6565

6666
>>> pskc = PSKC()
67-
>>> device = pskc.add_device(manufacturer='Tokens INC.')
67+
>>> device = pskc.add_device(manufacturer='Tokens INC.', serial='456')
6868
>>> len(pskc.keys)
6969
0
70-
>>> key = device.add_key(id='123', serial='456')
70+
>>> key = device.add_key(id='123')
7171
>>> len(pskc.keys)
7272
1
7373
>>> key.id

tests/test_write.doctest

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
test_write.doctest - tests for writing PSKC files
22

3-
Copyright (C) 2014-2024 Arthur de Jong
3+
Copyright (C) 2014-2025 Arthur de Jong
44

55
This library is free software; you can redistribute it and/or
66
modify it under the terms of the GNU Lesser General Public
@@ -625,8 +625,8 @@ is not allowed in the RFC 6030 schema. Note that device properties that are
625625
set on one key end up being applied to both keys.
626626

627627
>>> pskc = PSKC()
628-
>>> device = pskc.add_device(manufacturer='TokenVendorAcme')
629-
>>> key = device.add_key(id='1', serial='123456', secret='1234', counter=42)
628+
>>> device = pskc.add_device(manufacturer='TokenVendorAcme', serial='123456')
629+
>>> key = device.add_key(id='1', secret='1234', counter=42)
630630
>>> key = device.add_key(id='pin0', secret='5678')
631631
>>> pskc.write(sys.stdout) #doctest: +ELLIPSIS +REPORT_UDIFF
632632
<?xml version="1.0" encoding="UTF-8"?>

0 commit comments

Comments
 (0)