Browse Source

limit what gets imported when importing *

main
John-Mark Gurney 4 years ago
parent
commit
b162960603
3 changed files with 6 additions and 0 deletions
  1. +2
    -0
      bitelab/config.py
  2. +2
    -0
      bitelab/mocks.py
  3. +2
    -0
      bitelab/snmp.py

+ 2
- 0
bitelab/config.py View File

@@ -31,6 +31,8 @@ from pydantic import BaseSettings, Field
import asyncio import asyncio
import aiokq import aiokq


__all__ = [ 'Settings' ]

# How to deal w/ private vars: # How to deal w/ private vars:
# https://web.archive.org/web/20201113005838/https://github.com/samuelcolvin/pydantic/issues/655 # https://web.archive.org/web/20201113005838/https://github.com/samuelcolvin/pydantic/issues/655
class Settings(BaseSettings): class Settings(BaseSettings):


+ 2
- 0
bitelab/mocks.py View File

@@ -28,6 +28,8 @@


from unittest.mock import AsyncMock, Mock from unittest.mock import AsyncMock, Mock


__all__ = [ 'wrap_subprocess_exec' ]

def wrap_subprocess_exec(mockobj, stdout=b'', stderr=b'', retcode=0): def wrap_subprocess_exec(mockobj, stdout=b'', stderr=b'', retcode=0):
assert isinstance(stdout, bytes) assert isinstance(stdout, bytes)
assert isinstance(stderr, bytes) assert isinstance(stderr, bytes)


+ 2
- 0
bitelab/snmp.py View File

@@ -35,6 +35,8 @@ import asyncio
import subprocess import subprocess
import unittest import unittest


__all__ = [ 'snmpget', 'snmpset', 'SNMPPower' ]

async def snmpget(host, oid, type): async def snmpget(host, oid, type):
p = await asyncio.create_subprocess_exec('snmpget', '-Oqv', host, oid, p = await asyncio.create_subprocess_exec('snmpget', '-Oqv', host, oid,
stdout=subprocess.PIPE) stdout=subprocess.PIPE)


Loading…
Cancel
Save