Skip to main content

FpTest

Release Status Build Status

Overview

class TerminateGponLinkTest(fptest.FpTest):
    def test_workorders(self):
        expected_workorders = [('LST-ONTDETAIL', 'WOS_Completed'), ('DEL-ONT', 'WOS_Completed')]
        actual_workorders = [(wo.name, wo.status) for wo in self.cart_order_tracing.outgoing_workorders]
        self.assertListEqual(expected_workorders, actual_workorders)

    def request(self):
        return """
<request>
    <so>
        <orderId>1412685518565</orderId>
        <sod>
           <!-- Snipped for brevity -->
"""

fptest.FpTest extends unittest.TestCase and overrides the setUp method to post the contents of request() to FP. It then parses ../runtime/FPNode/cartOrderTracing.00000.log into a format where it is much easier to pull information out of the trace file.

You can then write tests in Python that are expressive and repeatable. I am using nosetests and the --with-xunit flag to output a file of test results that Jenkins is post-processing!

Installation

pip install fptest

Setup

The following file structure is assumed:

FP-Project/
|-- IntegrationTests
`-- runtime
    `-- FPNode

The directory structure is important as FpTest will look in ../runtime/FPNode for the cartOrderTracing log file.

Samples

There are two samples in the /samples directory of this project. These are tests that I am successfully running against my instance of FP.

Documentation to come

  • Explanation of setting up cartridge simulators to pass / fail depending on input values

  • Explanation of raw_params and params in the work order

  • Explanation of self.fp_url and self.fp_node_dir

  • Explanation of Trace and WorkOrder

  • Order id and self.now()

Metadata

Release files for fptest 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fptest 0.1.1
File Size Uploaded Provenance Actions
fptest-0.1.1.tar.gz 4.5 kB Without provenance Details for fptest-0.1.1.tar.gz

Release files / fptest-0.1.1.tar.gz

Download URL fptest-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b6b9e4706fd2d0f8354c65deb5d1742f7e2a55e65387dfe4a431e36444ec7f93
BLAKE2b-256 checksum
How to use checksums
5fe3fd0bb792b41e143cde82dede500cb21ed30926ff8fb9b02619815fc56e10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fptest 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page