Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

Owo Sugiana / linkaja-crypt

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • linkaja-crypt
  • test
  • payment.py
  • Owo Sugiana's avatar
    Kali pertama · 6333e5ad
    Owo Sugiana committed Mar 11, 2021
    6333e5ad
payment.py 392 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import unittest
import json
from linkaja.crypt.payment import Crypt


class Coba(unittest.TestCase):
    def test_encrypt(self):
        d = dict(invoice_id='1234')
        raw1 = json.dumps(d)
        key = '1234'
        c = Crypt(key)
        crypted = c.encrypt(raw1)
        raw2 = c.decrypt(crypted)
        self.assertEqual(raw1, raw2)


if __name__ == '__main__':
    unittest.main()