-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
114 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import zonefilegen.parsing | ||
|
||
|
||
def test_simple_parsing(): | ||
input_file = "docs/sample.toml" | ||
|
||
(fwd_zone, reverse_zones, soa_dict, input_digest) = zonefilegen.parsing.parse_toml_file(input_file) | ||
assert fwd_zone.name == "example.com." | ||
assert fwd_zone.default_ttl == 3600 | ||
|
||
found_mail1 = False | ||
for rec in fwd_zone.records: | ||
if rec.name == 'mail1.example.com.': | ||
found_mail1 = True | ||
assert rec.record_class == 'IN' | ||
assert rec.record_type == 'A' | ||
assert rec.data == '198.51.100.3' | ||
assert rec.ttl == 300 | ||
|
||
assert found_mail1 |