def test_from_mnemonic(self):
    tests = [['00000000000000000000000000000000', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about', 'c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04', 'EXAMPLE_KEY'], ['7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f', 'legal winner thank year wave sausage worth useful legal winner thank yellow', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['80808080808080808080808080808080', 'letter advice cage absurd amount doctor acoustic avoid letter advice cage above', 'd71de856f81a8acc65e6fc851a38d4d7ec216fd0796d0a6827a3ad6ed5511a30fa280f12eb2e47ed2ac03b5c462a0358d18d69fe4f985ec81778c1b370b652a8', 'EXAMPLE_KEY'], ['ffffffffffffffffffffffffffffffff', 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong', 'ac27495480225222079d7be181583751e86f571027b0497b5b5d11218e0a8a13332572917f0f8e5a589620c6f15b11c61dee327651a14c34e18231052e48c069', 'EXAMPLE_KEY'], ['000000000000000000000000000000000000000000000000', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon agent', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f', 'legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will', 'f2b94508732bcbacbcc020faefecfc89feafa6649a5491b8c952cede496c214a0c7b3c392d168748f2d4a612bada0753b52a1c7ac53c1e93abd5c6320b9e95dd', 'EXAMPLE_KEY'], ['808080808080808080808080808080808080808080808080', 'letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter always', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['ffffffffffffffffffffffffffffffffffffffffffffffff', 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo when', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['0000000000000000000000000000000000000000000000000000000000000000', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art', 'bda85446c68413707090a52022edd26a1c9462295029f2e60cd7c4f2bbd3097170af7a4d73245cafa9c3cca8d561a7c3de6f5d4a10be8ed2a5e608d68f92fcc8', 'EXAMPLE_KEY'], ['7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f', 'legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth title', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['8080808080808080808080808080808080808080808080808080808080808080', 'letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic bless', 'c0c519bd0e91a2ed54357d9d1ebef6f5af218a153624cf4f2da911a0ed8f7a09e2ef61af0aca007096df430022f7a2b6fb91661a9589097069720d015e4e982f', 'EXAMPLE_KEY'], ['ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['9e885d952ad362caeb4efe34a8e91bd2', 'ozone drill grab fiber curtain grace pudding thank cruise elder eight picnic', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c', 'hamster diagram private dutch cause delay private meat slide toddler razor book happy fancy gospel tennis maple dilemma loan word shrug inflict delay length', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'scheme spot photo card baby mountain device kick cradle pact join borrow', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'horn tenant knee talent sponsor spell gate clip pulse soap slush warm silver nephew swap uncle crack brave', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['23db8160a31d3e0dca3688ed941adbf3', 'cat swing flag economy stadium alone churn speed unique patch report train', 'deb5f45449e615feff5640f2e49f933ff51895de3b4381832b3139941c57b59205a42480c52175b6efcffaa58a2503887c1e8b363a707256bdd2b587b46541f5', 'EXAMPLE_KEY'], ['8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0', 'light rule cinnamon wrap drastic word pride squirrel upgrade then income fatal apart sustain crack supply proud access', '4cbdff1ca2db800fd61cae72a57475fdc6bab03e441fd63f96dabd1f183ef5b782925f00105f318309a7e9c3ea6967c7801e46c8a58082674c860a37b93eda02', 'EXAMPLE_KEY'], ['066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad', 'all hour make first leader extend hole alien behind guard gospel lava path output census museum junior mass reopen famous sing advance salt reform', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'vessel ladder alter error federal sibling chat ability sun glass valve picture', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'scissors invite lock maple supreme raw rapid void congress muscle digital elegant little brisk hair mango congress clump', '7b4a10be9d98e6cba265566db7f136718e1398c71cb581e1b2f464cac1ceedf4f3e274dc270003c670ad8d02c4558b2f8e39edea2775c9e232c7cb798b069e88', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold', '01f5bced59dec48e362f2c45b5de68b9fd6c92c6634f44d6d40aab69056506f0e35524a518034ddc1192e1dacd32c1ed3eaa3c3b131c88ed8e7e54c49a5d0998', 'EXAMPLE_KEY']]
    for (entropy, mnemonic, seed, xprv) in tests:
        private_key = HDPrivateKey.from_mnemonic(mnemonic, b'TREZOR')
        self.assertEqual(private_key.xprv(), xprv)
def test_from_mnemonic(self):
    tests = [['00000000000000000000000000000000', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about', 'c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04', 'EXAMPLE_KEY'], ['7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f', 'legal winner thank year wave sausage worth useful legal winner thank yellow', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['80808080808080808080808080808080', 'letter advice cage absurd amount doctor acoustic avoid letter advice cage above', 'd71de856f81a8acc65e6fc851a38d4d7ec216fd0796d0a6827a3ad6ed5511a30fa280f12eb2e47ed2ac03b5c462a0358d18d69fe4f985ec81778c1b370b652a8', 'EXAMPLE_KEY'], ['ffffffffffffffffffffffffffffffff', 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong', 'ac27495480225222079d7be181583751e86f571027b0497b5b5d11218e0a8a13332572917f0f8e5a589620c6f15b11c61dee327651a14c34e18231052e48c069', 'EXAMPLE_KEY'], ['000000000000000000000000000000000000000000000000', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon agent', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f', 'legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will', 'f2b94508732bcbacbcc020faefecfc89feafa6649a5491b8c952cede496c214a0c7b3c392d168748f2d4a612bada0753b52a1c7ac53c1e93abd5c6320b9e95dd', 'EXAMPLE_KEY'], ['808080808080808080808080808080808080808080808080', 'letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter always', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['ffffffffffffffffffffffffffffffffffffffffffffffff', 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo when', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['0000000000000000000000000000000000000000000000000000000000000000', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art', 'bda85446c68413707090a52022edd26a1c9462295029f2e60cd7c4f2bbd3097170af7a4d73245cafa9c3cca8d561a7c3de6f5d4a10be8ed2a5e608d68f92fcc8', 'EXAMPLE_KEY'], ['7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f', 'legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth title', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['8080808080808080808080808080808080808080808080808080808080808080', 'letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic bless', 'c0c519bd0e91a2ed54357d9d1ebef6f5af218a153624cf4f2da911a0ed8f7a09e2ef61af0aca007096df430022f7a2b6fb91661a9589097069720d015e4e982f', 'EXAMPLE_KEY'], ['ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['9e885d952ad362caeb4efe34a8e91bd2', 'ozone drill grab fiber curtain grace pudding thank cruise elder eight picnic', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c', 'hamster diagram private dutch cause delay private meat slide toddler razor book happy fancy gospel tennis maple dilemma loan word shrug inflict delay length', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'scheme spot photo card baby mountain device kick cradle pact join borrow', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'horn tenant knee talent sponsor spell gate clip pulse soap slush warm silver nephew swap uncle crack brave', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['23db8160a31d3e0dca3688ed941adbf3', 'cat swing flag economy stadium alone churn speed unique patch report train', 'deb5f45449e615feff5640f2e49f933ff51895de3b4381832b3139941c57b59205a42480c52175b6efcffaa58a2503887c1e8b363a707256bdd2b587b46541f5', 'EXAMPLE_KEY'], ['8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0', 'light rule cinnamon wrap drastic word pride squirrel upgrade then income fatal apart sustain crack supply proud access', '4cbdff1ca2db800fd61cae72a57475fdc6bab03e441fd63f96dabd1f183ef5b782925f00105f318309a7e9c3ea6967c7801e46c8a58082674c860a37b93eda02', 'EXAMPLE_KEY'], ['066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad', 'all hour make first leader extend hole alien behind guard gospel lava path output census museum junior mass reopen famous sing advance salt reform', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'vessel ladder alter error federal sibling chat ability sun glass valve picture', 'EXAMPLE_KEY', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'scissors invite lock maple supreme raw rapid void congress muscle digital elegant little brisk hair mango congress clump', '7b4a10be9d98e6cba265566db7f136718e1398c71cb581e1b2f464cac1ceedf4f3e274dc270003c670ad8d02c4558b2f8e39edea2775c9e232c7cb798b069e88', 'EXAMPLE_KEY'], ['EXAMPLE_KEY', 'void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold', '01f5bced59dec48e362f2c45b5de68b9fd6c92c6634f44d6d40aab69056506f0e35524a518034ddc1192e1dacd32c1ed3eaa3c3b131c88ed8e7e54c49a5d0998', 'EXAMPLE_KEY']]
    for (entropy, mnemonic, seed, xprv) in tests:
        private_key = HDPrivateKey.from_mnemonic(mnemonic, b'TREZOR')
        self.assertEqual(private_key.xprv(), xprv)