-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Improving unit test coverage
- Loading branch information
1 parent
2199149
commit 0e5a4f9
Showing
8 changed files
with
171 additions
and
8 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from functools import partial | ||
from unittest import TestCase | ||
|
||
from ragger.navigator.nano_navigator import NanoNavigator | ||
from ragger.backend import LedgerCommBackend, LedgerWalletBackend, SpeculosBackend | ||
from ragger.firmware import Firmware | ||
|
||
|
||
class TestNanoNavigator(TestCase): | ||
|
||
def test___init__ok(self): | ||
for backend_cls in [partial(SpeculosBackend, "some app"), LedgerCommBackend, LedgerWalletBackend]: | ||
backend = backend_cls(Firmware.NANOS) | ||
navigator = NanoNavigator(backend, Firmware.NANOS) | ||
Check notice Code scanning / CodeQL Unused local variable Note test
Variable navigator is not used.
|
||
|
||
def test___init__nok(self): | ||
with self.assertRaises(ValueError): | ||
NanoNavigator("whatever", Firmware.STAX) |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from functools import partial | ||
from unittest import TestCase | ||
|
||
from ragger.navigator.stax_navigator import StaxNavigator | ||
from ragger.backend import LedgerCommBackend, LedgerWalletBackend, SpeculosBackend | ||
from ragger.firmware import Firmware | ||
|
||
|
||
class TestStaxNavigator(TestCase): | ||
|
||
def test___init__ok(self): | ||
for backend_cls in [partial(SpeculosBackend, "some app"), LedgerCommBackend, LedgerWalletBackend]: | ||
backend = backend_cls(Firmware.STAX) | ||
navigator = StaxNavigator(backend, Firmware.STAX) | ||
Check notice Code scanning / CodeQL Unused local variable Note test
Variable navigator is not used.
|
||
|
||
def test___init__nok(self): | ||
with self.assertRaises(ValueError): | ||
StaxNavigator("whatever", Firmware.NANOS) |
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