"""Validation tests — no network calls."""

import unittest

from dnsrobot import DNSRobot


class TestValidation(unittest.TestCase):
    def setUp(self):
        self.dr = DNSRobot()

    def test_dns_lookup_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.dns_lookup("")

    def test_whois_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.whois_lookup("")

    def test_ssl_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.ssl_check("")

    def test_spf_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.spf_check("")

    def test_dkim_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.dkim_check("")

    def test_dmarc_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.dmarc_check("")

    def test_mx_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.mx_lookup("")

    def test_ns_requires_domain(self):
        with self.assertRaises(ValueError):
            self.dr.ns_lookup("")

    def test_ip_requires_ip(self):
        with self.assertRaises(ValueError):
            self.dr.ip_lookup("")

    def test_http_headers_requires_url(self):
        with self.assertRaises(ValueError):
            self.dr.http_headers("")

    def test_port_requires_host(self):
        with self.assertRaises(ValueError):
            self.dr.port_check("", 80)

    def test_port_requires_port(self):
        with self.assertRaises(ValueError):
            self.dr.port_check("example.com", 0)


if __name__ == "__main__":
    unittest.main()
