Skip to content

Commit

Permalink
create package
Browse files Browse the repository at this point in the history
  • Loading branch information
Demetrous-fd committed Sep 8, 2023
1 parent 4a69797 commit 27fc9bd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/.idea
/.idea
/dist
/src/btoa.egg-info
/venv
__pycache__
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "btoa"
version = "1.0"
authors = [
{ name="LazyDeus", email="dimaprodeus@yandex.ru" },
]
description = "Python implementation btoa and atob functions from javascript"
requires-python = ">=3.6"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
"Homepage" = "https://github.com/Demetrous-fd/btoa"
"Bug Tracker" = "https://github.com/Demetrous-fd/btoa/issues"
13 changes: 0 additions & 13 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions tests/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from unittest import TestCase

from btoa import btoa, atob


class MainCase(TestCase):
def test_btoa(self):
self.assertEqual(
btoa("Hello World"),
"SGVsbG8gV29ybGQ="
)
self.assertEqual(
btoa('s8ë{LóüÈ@É"¹ÏLôa"¢f#½2r[¢ÀCwÀ¯ÅaõdUí£tùºm94±]!'),
"czjre0zz/MhAySK5z0z0YSKiZiO9MnJbosBDd8CvxWH1ZFXto3T5um05NLFdIQ=="
)

def test_atob(self):
self.assertEqual(
atob("SGVsbG8gV29ybGQ="),
"Hello World"
)
self.assertEqual(
atob("czjre0zz/MhAySK5z0z0YSKiZiO9MnJbosBDd8CvxWH1ZFXto3T5um05NLFdIQ=="),
's8ë{LóüÈ@É"¹ÏLôa"¢f#½2r[¢ÀCwÀ¯ÅaõdUí£tùºm94±]!'
)

0 comments on commit 27fc9bd

Please sign in to comment.