Skip to main content

Robot Framework library for generating BSNs (Dutch citizen service number)

Project description

BSNLibrary for Robot Framework

Robot Framework Library for generating a random BSN (Burger Service Nummer, i.e. a Dutch citizen service number) for test purposes.

A BSN is used in Netherlands to identify a person for government organisations, see this information of the Dutch government. The number consists of 9 digits and has to pass the eleven test.

This test can be explained with the example 211551557. Each digit is multiplied with its position and the results are added up together:

(9*2) + (8*1) + (7*1) + (6*5) + (5*5) + (4*1) + (3*5) + (2*5) - (1*7) = 110

Note that the digit in position 1 is subtracted from the other results. The total sum can be divided by 11, which means that this number has passed the eleven test.

This library generates BSNs for test purposes in the sense that it generates random 9 digit numbers that pass the eleven test. By coincidence a generated number could be a real person's BSN. Yet this library cannot violate such a person's privacy, because it cannot tell you whether a number belongs to a real person or not, nor will it provide you with any personal data related to a BSN. Obviously you should only use this library in test environments.

This library brings the following features to Robot Framework:

  • generating a valid BSN
  • generating a BSN that is unique within the current test run
  • generating a number that will not pass the eleven test
  • generating a BSN that starts with specific digits
  • generating a BSN that is less than 9 digits long
  • checking if a given number passes the eleven test
  • returning a list of BSNs generated during the current test run
  • specifying BSNs that should not be generated

Possible use cases:

  • A test message that is processed by one or more systems can be tracked by its unique BSN
  • Creating messages with BSNs in a certain range that leads to a certain response from a system or stub
  • Checking whether a test message contains a valid BSN

Backward compatibility

BSNLibrary v1.0.0 and later is not compatible with previous versions in the sense that is does not allow you to validate a BSN with Generate BSN. You should use Validate BSN instead. If your test suite still uses Generate BSN for validation it will generate an error saying that the length of given exceeds the maximum value. In case you have test suites using Generate BSN for validation you can install BSNLibrary v0.4.0 for a smooth transition:

pip install robotframework-bsnlibrary==0.4.0

Your test suite will still run, but you will receive a warning of any deprecated use of Generate BSN and a recommendation to replace it with the keyword Validate BSN. This allows you to convert your test suites at your own pace.

Installation

pip install robotframework-bsnlibrary

General information

Keyword documentation

Installation package on PyPI

Release notes

Create date: 01-03-2020

Author: Henk van den Akker

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework-bsnlibrary-1.1.0.tar.gz (71.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_bsnlibrary-1.1.0-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file robotframework-bsnlibrary-1.1.0.tar.gz.

File metadata

File hashes

Hashes for robotframework-bsnlibrary-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ef18825f491398da1073a416f3bf52684fb5e0b52fcc0babfa5a40d1557fc85c
MD5 5e779fb55d04e2507105fc13c908326c
BLAKE2b-256 bec590f878bc7f6b564fb375a6ee25f9e415e8c736e0d63d9218602b823b2752

See more details on using hashes here.

File details

Details for the file robotframework_bsnlibrary-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_bsnlibrary-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bd516c5ee8b6a6029ce9fcf54c08b8f9961bbf967db69425c25e1c634bf342f
MD5 af33e0d5815ea51823e7edaf3473643c
BLAKE2b-256 4b01f9051ff12458d5a21033016f5d5a46b52c7ba2e46489923105afeaf1b6f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page