initial structure
This commit is contained in:
parent
15fdd56002
commit
90e0cf3d94
11
.vscode/easycode.ignore
vendored
Normal file
11
.vscode/easycode.ignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
node_modules/
|
||||
dist/
|
||||
vendor/
|
||||
cache/
|
||||
.*/
|
||||
*.min.*
|
||||
*.test.*
|
||||
*.spec.*
|
||||
*.bundle.*
|
||||
*.bundle-min.*
|
||||
*.log
|
||||
0
pyproject.toml
Normal file
0
pyproject.toml
Normal file
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
requests
|
||||
4
sccpy/__init__.py
Normal file
4
sccpy/__init__.py
Normal file
@ -0,0 +1,4 @@
|
||||
from .core import getOrg, getOrgMembers, getUser
|
||||
#from .modules import *
|
||||
|
||||
__all__ = ["getOrg", "getOrgMembers", "getUser"]
|
||||
25
sccpy/core.py
Normal file
25
sccpy/core.py
Normal file
@ -0,0 +1,25 @@
|
||||
# core.py
|
||||
|
||||
def getOrg(org_id):
|
||||
"""
|
||||
Fetches details about an organization.
|
||||
:param org_id: The ID of the organization.
|
||||
:return: A dictionary with organization details.
|
||||
"""
|
||||
return {"id": org_id, "name": f"Org-{org_id}"}
|
||||
|
||||
def getOrgMembers(org_id):
|
||||
"""
|
||||
Fetches a list of members for a given organization.
|
||||
:param org_id: The ID of the organization.
|
||||
:return: A list of dictionaries representing members.
|
||||
"""
|
||||
return [{"id": i, "name": f"Member-{i}"} for i in range(1, 6)]
|
||||
|
||||
def getUser(user_id):
|
||||
"""
|
||||
Fetches details about a specific user.
|
||||
:param user_id: The ID of the user.
|
||||
:return: A dictionary with user details.
|
||||
"""
|
||||
return {"id": user_id, "name": f"User-{user_id}"}
|
||||
22
sccpy/tests/test_core.py
Normal file
22
sccpy/tests/test_core.py
Normal file
@ -0,0 +1,22 @@
|
||||
# test_core.py
|
||||
import unittest
|
||||
from sccpy.core import getOrg, getOrgMembers, getUser
|
||||
|
||||
class TestSccpyCore(unittest.TestCase):
|
||||
def test_getOrg(self):
|
||||
org = getOrg(1)
|
||||
self.assertEqual(org["id"], 1)
|
||||
self.assertIn("name", org)
|
||||
|
||||
def test_getOrgMembers(self):
|
||||
members = getOrgMembers(1)
|
||||
self.assertEqual(len(members), 5)
|
||||
self.assertIn("name", members[0])
|
||||
|
||||
def test_getUser(self):
|
||||
user = getUser(1)
|
||||
self.assertEqual(user["id"], 1)
|
||||
self.assertIn("name", user)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
12
setup.py
Normal file
12
setup.py
Normal file
@ -0,0 +1,12 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="sccpy",
|
||||
version="0.1.0",
|
||||
description="A library for SCC operations",
|
||||
author="Your Name",
|
||||
author_email="your.email@example.com",
|
||||
packages=find_packages(),
|
||||
install_requires=[],
|
||||
python_requires=">=3.6",
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user