[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 60d9d90 07/13: Added tests for interface selection
From: |
Ian Dunn |
Subject: |
[elpa] master 60d9d90 07/13: Added tests for interface selection |
Date: |
Sat, 15 Apr 2017 16:02:44 -0400 (EDT) |
branch: master
commit 60d9d90841b90aa8019b554b5038e21156bedc64
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Added tests for interface selection
* enwc-test.el (enwc-test-select-interface-save): Test for selecting
interface
using ip and saving the interface.
(enwc-test-select-interface-no-save): Test for selecting interface using
ifconfig and not saving the interface.
---
enwc-test.el | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/enwc-test.el b/enwc-test.el
new file mode 100644
index 0000000..5b3c6f1
--- /dev/null
+++ b/enwc-test.el
@@ -0,0 +1,66 @@
+;;; enwc-test.el --- Tests for ENWC
+
+;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
+
+;; Author: Ian Dunn <address@hidden>
+;; Keywords: external, network, wicd, manager, nm
+;; Version: 2.0
+;; Package-Requires: ((emacs "25.1"))
+;; Homepage: https://savannah.nongnu.org/p/enwc
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'enwc)
+(require 'ert)
+
+;; Test enwc-setup
+
+(ert-deftest enwc-test-select-interface-save ()
+ ;; Test saving the interfaces and using the ip selection back-end
+ (let ((enwc-interface-list-function 'enwc--ip-interface-list)
+ (enwc-ask-to-save-interfaces t)
+ ;; Temporarily save our changes to a different file
+ (custom-file (make-temp-file "enwc-custom-"))
+ (enwc-wired-device "")
+ (enwc-wireless-device ""))
+ (enwc--setup-select-interfaces)
+ (should (not (string-empty-p enwc-wired-device)))
+ (should (not (string-empty-p enwc-wireless-device)))
+ ;; Test whether the interfaces were saved
+ (let ((enwc-wired-device "")
+ (enwc-wireless-device ""))
+ (load custom-file)
+ (should (not (string-empty-p enwc-wired-device)))
+ (should (not (string-empty-p enwc-wireless-device))))
+ ;; Delete our temporary custom file
+ (delete-file custom-file)))
+
+(ert-deftest enwc-test-select-interface-no-save ()
+ ;; Test not saving the interfaces and using the ifconfig selection back-end
+ (let ((enwc-interface-list-function 'enwc--ifconfig-interface-list)
+ (enwc-ask-to-save-interfaces nil)
+ ;; Temporarily save our "changes" to a different file
+ (custom-file (make-temp-file "enwc-custom-"))
+ (enwc-wired-device "")
+ (enwc-wireless-device ""))
+ (enwc--setup-select-interfaces)
+ (should (not (string-empty-p enwc-wired-device)))
+ (should (not (string-empty-p enwc-wireless-device)))
+ ;; Test whether the interfaces were saved
+ (let ((enwc-wired-device "")
+ (enwc-wireless-device ""))
+ (load custom-file)
+ (should (string-empty-p enwc-wired-device))
+ (should (string-empty-p enwc-wireless-device)))
+ ;; Delete our temporary custom file
+ (delete-file custom-file)))
+
+(provide 'enwc-test)
+
+;; Local Variables:
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; enwc-test.el ends here
- [elpa] master ed920db 02/13: Inform user if enwc-setup has already been called, (continued)
- [elpa] master ed920db 02/13: Inform user if enwc-setup has already been called, Ian Dunn, 2017/04/15
- [elpa] master b9869fc 04/13: Demoted setup error to message, Ian Dunn, 2017/04/15
- [elpa] master a61d78e 03/13: Ask the user about saving network interfaces during `enwc-setup', Ian Dunn, 2017/04/15
- [elpa] master bf628ce 05/13: Remove sort column when switching between wired and wireless, Ian Dunn, 2017/04/15
- [elpa] master 0ebaf4e 09/13: Restrict enwc-auto-scan to status variable, Ian Dunn, 2017/04/15
- [elpa] master 17d530d 10/13: Add type for enwc-enable-auto-scan-on-startup, Ian Dunn, 2017/04/15
- [elpa] master 886420d 06/13: Split enwc-setup contents into separate functions, Ian Dunn, 2017/04/15
- [elpa] master 8cc5c8f 08/13: Fixed bug in enwc-refresh-widths, Ian Dunn, 2017/04/15
- [elpa] master 9893d7f 12/13: Updated version to 2.0, Ian Dunn, 2017/04/15
- [elpa] master b7529b1 01/13: Fixed wired connection and interface., Ian Dunn, 2017/04/15
- [elpa] master 60d9d90 07/13: Added tests for interface selection,
Ian Dunn <=
- [elpa] master 7f15c06 11/13: Various fixes and improvements, Ian Dunn, 2017/04/15
- [elpa] master 2dad73c 13/13: Merge commit '9893d7f17a2ee7f83587c305c256bd1300995125', Ian Dunn, 2017/04/15