Skip to content

Commit

Permalink
added model coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
git-elliot committed Nov 17, 2024
1 parent 6773fef commit 8b49056
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for authentication using OIDC

steps:
- name: Checkout
Expand Down Expand Up @@ -50,7 +52,9 @@ jobs:
run: dart pub publish --dry-run

- name: Publish Package
run: dart pub publish -f
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: 'pub.dev'

- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v3
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## 5.0.4


## 5.0.3
Updated dependencies

Expand Down
4 changes: 2 additions & 2 deletions pub_login.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This script creates/updates credentials.json file which is used
# This script creates/updates ~/Library/Application\ Support/dart/pub-credentials.json file which is used
# to authorize publisher when publishing packages to pub.dev

# Checking whether the secrets are available as environment
Expand Down Expand Up @@ -30,7 +30,7 @@ cat <<EOF > $HOME/.config/dart/pub-credentials.json
"refreshToken":"${PUB_DEV_PUBLISH_REFRESH_TOKEN}",
"tokenEndpoint":"${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}",
"idToken": "${PUB_DEV_PUBLISH_ID_TOKEN}",
"scopes":["openid","https://www.googleapis.com/auth/userinfo.email"],
"scopes":["https://www.googleapis.com/auth/userinfo.email","openid"],
"expiration":${PUB_DEV_PUBLISH_EXPIRATION}
}
EOF
33 changes: 33 additions & 0 deletions test/network_tools_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ void main() {
test('Running OpenPort tests', () {
final actualOpenPort = openPort;
final expectedOpenPort = OpenPort(port);
final json = <String, dynamic>{
'port': expectedOpenPort.port,
'isOpen': expectedOpenPort.isOpen,
};

if (actualOpenPort != null) {
expect(actualOpenPort, expectedOpenPort);
Expand All @@ -62,6 +66,35 @@ void main() {
expect(expectedOpenPort.isOpen, equals(true)); // because default is true
expect(expectedOpenPort.hashCode, expectedOpenPort.port.hashCode);
expect(expectedOpenPort.toString(), expectedOpenPort.port.toString());
expect(expectedOpenPort.toJson(), json);
expect(OpenPort.fromJson(json), expectedOpenPort);
});
test('Running ARPData tests', () {
final json = <String, dynamic>{
'hostname': 'Local',
'iPAddress': '192.168.1.1',
'macAddress': '00:00:3F:C1:DD:3E',
'interfaceName': 'eth0',
'interfaceType': 'bridge',
};

final arpData = ARPData.fromJson(json);
expect(arpData.toJson(), json);
expect(arpData.notNullIPAddress, true);
expect(arpData.notNullMacAddress, true);
expect(arpData.notNullInterfaceType, true);
});

test('Running Vendor tests', () {
final json = <String, dynamic>{
'macPrefix': '00:00:0C',
'vendorName': 'Cisco Systems, Inc',
'private': 'false',
'blockType': 'MA-L',
'lastUpdate': '2015/11/17',
};
final vendor = Vendor.fromJson(json);
expect(vendor.toJson(), json);
});
});

Expand Down

0 comments on commit 8b49056

Please sign in to comment.