def test_parse_zone_file(self):
        zone_file = """$ORIGIN realtest.com.
$TTL 86400
@ IN SOA ns1.softlayer.com. support.softlayer.com. (
                       2014052300        ; Serial
                       7200              ; Refresh
                       600               ; Retry
                       1728000           ; Expire
                       43200)            ; Minimum

@                      86400    IN NS    ns1.softlayer.com.
@                      86400    IN NS    ns2.softlayer.com.

                        IN MX 10 test.realtest.com.
testing                86400    IN A     127.0.0.1
testing1               86400    IN A     12.12.0.1
server2      IN   A  1.0.3.4
ftp                             IN  CNAME server2
dev.realtest.com    IN  TXT "This is just a test of the txt record"
    IN  AAAA  2001:db8:10::1
spf  IN TXT "v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a"

"""
        expected = [{'data': 'ns1.softlayer.com.',
                     'record': '@',
                     'type': 'NS',
                     'ttl': '86400'},
                    {'data': 'ns2.softlayer.com.',
                     'record': '@',
                     'type': 'NS',
                     'ttl': '86400'},
                    {'data': '127.0.0.1',
                     'record': 'testing',
                     'type': 'A',
                     'ttl': '86400'},
                    {'data': '12.12.0.1',
                     'record': 'testing1',
                     'type': 'A',
                     'ttl': '86400'},
                    {'data': '1.0.3.4',
                     'record': 'server2',
                     'type': 'A',
                     'ttl': None},
                    {'data': 'server2',
                     'record': 'ftp',
                     'type': 'CNAME',
                     'ttl': None},
                    {'data': '"This is just a test of the txt record"',
                     'record': 'dev.realtest.com',
                     'type': 'TXT',
                     'ttl': None},
                    {'data': '"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a"',
                     'record': 'spf',
                     'type': 'TXT',
                     'ttl': None}]
        zone, records, bad_lines = zone_import.parse_zone_details(zone_file)
        self.assertEqual(zone, 'realtest.com')
        self.assertEqual(records, expected)
        self.assertEqual(len(bad_lines), 13)
    def test_parse_zone_file(self):
        zone_file = """$ORIGIN realtest.com.
$TTL 86400
@ IN SOA ns1.softlayer.com. support.softlayer.com. (
                       2014052300        ; Serial
                       7200              ; Refresh
                       600               ; Retry
                       1728000           ; Expire
                       43200)            ; Minimum

@                      86400    IN NS    ns1.softlayer.com.
@                      86400    IN NS    ns2.softlayer.com.

                        IN MX 10 test.realtest.com.
testing                86400    IN A     127.0.0.1
testing1               86400    IN A     12.12.0.1
server2      IN   A  1.0.3.4
ftp                             IN  CNAME server2
dev.realtest.com    IN  TXT "This is just a test of the txt record"
    IN  AAAA  2001:db8:10::1
spf  IN TXT "v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a"

"""
        expected = [{
            'data': 'ns1.softlayer.com.',
            'record': '@',
            'type': 'NS',
            'ttl': '86400'
        }, {
            'data': 'ns2.softlayer.com.',
            'record': '@',
            'type': 'NS',
            'ttl': '86400'
        }, {
            'data': '127.0.0.1',
            'record': 'testing',
            'type': 'A',
            'ttl': '86400'
        }, {
            'data': '12.12.0.1',
            'record': 'testing1',
            'type': 'A',
            'ttl': '86400'
        }, {
            'data': '1.0.3.4',
            'record': 'server2',
            'type': 'A',
            'ttl': None
        }, {
            'data': 'server2',
            'record': 'ftp',
            'type': 'CNAME',
            'ttl': None
        }, {
            'data': '"This is just a test of the txt record"',
            'record': 'dev.realtest.com',
            'type': 'TXT',
            'ttl': None
        }, {
            'data': '"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a"',
            'record': 'spf',
            'type': 'TXT',
            'ttl': None
        }]
        zone, records, bad_lines = zone_import.parse_zone_details(zone_file)
        self.assertEqual(zone, 'realtest.com')
        self.assertEqual(records, expected)
        self.assertEqual(len(bad_lines), 13)