def METHOD_NAME(self):
    """
    Ensure that hosts.add_host isn't adding duplicates and that
    it's formatting the output correctly
    """
    # instead of using the 'clean' hosts file we're going to
    # use an empty one so we can prove the syntax of the entries
    # being added by the hosts module
    self.__clear_hosts()
    with salt.utils.files.fopen(self.hosts_file, "w"):
        pass
    self.assertTrue(
        self.run_function("hosts.add_host", ["192.168.1.3", "host3.fqdn.com"])
    )
    self.assertTrue(
        self.run_function("hosts.add_host", ["192.168.1.1", "host1.fqdn.com"])
    )
    self.assertTrue(self.run_function("hosts.add_host", ["192.168.1.1", "host1"]))
    self.assertTrue(
        self.run_function("hosts.add_host", ["192.168.1.2", "host2.fqdn.com"])
    )
    self.assertTrue(self.run_function("hosts.add_host", ["192.168.1.2", "host2"]))
    self.assertTrue(
        self.run_function("hosts.add_host", ["192.168.1.2", "oldhost2"])
    )
    self.assertTrue(
        self.run_function("hosts.add_host", ["192.168.1.2", "host2-reorder"])
    )
    self.assertTrue(
        self.run_function("hosts.add_host", ["192.168.1.1", "host1-reorder"])
    )
    # now read the lines and ensure they're formatted correctly
    with salt.utils.files.fopen(self.hosts_file, "r") as fp_:
        lines = salt.utils.stringutils.to_unicode(fp_.read()).splitlines()
    self.assertEqual(
        lines,
        [
            "192.168.1.3\t\thost3.fqdn.com",
            "192.168.1.1\t\thost1.fqdn.com host1 host1-reorder",
            "192.168.1.2\t\thost2.fqdn.com host2 oldhost2 host2-reorder",
        ],
    )