Exemple #1
0
import cli
import naz
import docker

from .utils import AsyncMock, MockStreamWriter, MockArgumentParser
from examples.example_klasses import ExampleRedisBroker, MySeqGen, MyRateLimiter


NAZ_CLIENT = naz.Client(
    smsc_host="127.0.0.1",
    smsc_port=2775,
    system_id="smppclient1",
    password="******",
    broker=ExampleRedisBroker(),
    sequence_generator=MySeqGen(),
    logger=naz.log.SimpleLogger(
        "naz.client", level="INFO", log_metadata={"environment": "production", "release": "canary"}
    ),
    enquire_link_interval=30.00,
    rate_limiter=MyRateLimiter(),
)

BAD_NAZ_CLIENT = MySeqGen()


class TestCli(TestCase):
    """
    run tests as:
        python -m unittest discover -v -s .
    run one testcase as:
Exemple #2
0
import naz
from examples.example_klasses import ExampleRedisBroker, MySeqGen, MyRateLimiter


# run as:
#  naz-cli --client examples.example_config.client
client = naz.Client(
    smsc_host="127.0.0.1",
    smsc_port=2775,
    system_id="smppclient1",
    password="******",
    broker=ExampleRedisBroker(),
    sequence_generator=MySeqGen(),
    logger=naz.log.SimpleLogger(
        "naz.client", level="INFO", log_metadata={"environment": "staging", "release": "canary"}
    ),
    enquire_link_interval=70.00,
    rateLimiter=MyRateLimiter(),
    address_range="^254",  # any msisdns beginning with 254. See Appendix A of SMPP spec doc
)