testing

how to make nose to log output of cases to separate files?

久未见 提交于 2019-12-24 12:44:07
问题 I am using nose to run a bunch of test cases. I would like to record output of each case to separate files, and to know result[success/failure] of each case. unfortunately, I can not figure out how to do it with nose. can anybody provide some clues? thank you 回答1: Firstly, this sounds like unusual usage , and may indicate that you should rethink your testing scheme. I can think of a couple of ways to address this. The simplest would be to have each test log itself instead of having nose do it

UISpec4J Capturing modal dialog, before the trigger finish

本小妞迷上赌 提交于 2019-12-24 12:35:13
问题 I have some code where I'm showing up a dialog with two textboxes and two buttons (as OK, and Cancel, typical login window). The execution of the main code after the ".setVisible(true)" is conditioned to the values entered on that modal window. The problem that I'm facing now is that if I do something like this: WindowInterceptor.init(new Trigger() { @Override public void run() throws Exception { LoginModal loginWin=new LoginModal(); loginWin.setVisible(true); if(loginWin.getPassword().equals

How to test an angular app with class inheritance?

 ̄綄美尐妖づ 提交于 2019-12-24 12:23:52
问题 I can test normal controllers fine. I cannot test controllers that inherit a base controller. This is how we've been defining subclassed-controllers: app.NavController = app.BaseController.extend({ ... }); This is the base: app.BaseController = Class.extend({ $scope: null, init: function($scope) { this.$scope = $scope; this.defineListeners(); this.defineScope(); }, defineListeners: function() { // this.$scope.$on('$destroy',this.destroy.bind(this)); }, ... }); app.controller('BaseController',

Testing a fs library function with Jest/Typescript

你离开我真会死。 提交于 2019-12-24 12:19:41
问题 I am trying to test a library function that I have written (it works in my code) but cannot get the testing with the mock of the fs to work. I have a series of functions for working with the OS wrapped in functions so different parts of the application can use the same calls. I have tried to follow this question with mocking the file system, but it does not seem to work for me. A short sample to demonstrate the basics of my issue are below: import * as fs from 'fs'; export function

Mockito calling same method with different Class paramter

你说的曾经没有我的故事 提交于 2019-12-24 12:14:02
问题 I am having a service whose method looks somewhat like this - class ServiceClass { @Inject EventService event; public void handleUser(User user) throws ServiceClassException { Customer customer = userToCustomer(user); CustomerDetail detail = userToCustomerDetail(user); try { Response response1 = event.generateEvent(customer); } catch(Exception e) { throw new ServiceClassException(); } try { Response response2 = event.generateEvent(detail); } catch(Exception e) { throw new

Using Haskell's Quickcheck to check transitivity

房东的猫 提交于 2019-12-24 12:01:32
问题 How can I get Quickcheck to check the transitive property in the code below? The code represents a stack of physical blocks. Blocks can only be placed on an empty table or another block using the operation MoveOnto bl b2 s , which is read as b2 is moved into and onto bl on stack or table s . My Quickcheck attempt just hangs and produces no result. import Test.QuickCheck data Block = Block Int deriving (Show,Eq) data Stack = EmptyTable | MoveOnto Block Block Stack deriving (Show,Eq) isOn ::

How Can I Check View Code Coverage with CakePHP Tests?

ⅰ亾dé卋堺 提交于 2019-12-24 11:57:28
问题 When testing controllers, I can legitimately achieve 100% code coverage, as shown here: Example of Correct Report of 100% Code Coverage Controller Code <?php App::uses('AppController', 'Controller'); class UsersController extends AppController { public function example($option = null) { if ($option == 'foo') { $some_var = 'hello'; } elseif ($option == 'bar') { $some_var = 'goodbye'; } $this->set(compact('option', 'some_var')); } } Test Code <?php App::uses('UsersController', 'Controller');

FAIL: test_nanmedian_all_axis (test_stats.TestNanFunc)

我的未来我决定 提交于 2019-12-24 11:36:23
问题 I just installed the newest development version of scipy : 0.17.0.dev0+7dd2b91 and tested it with scipy.test . I get a single failure: ====================================================================== FAIL: test_nanmedian_all_axis (test_stats.TestNanFunc) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/scipy/stats/tests/test_stats.py", line 242, in test_nanmedian_all_axis assert_equal

Spring integration test with mockmvc throws org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json' not supported

风流意气都作罢 提交于 2019-12-24 11:34:52
问题 I have a weird problem with a spring integrationtest. I have a working controller and application that runs on tomcat. However in my integration test I get the following stacktrace: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json' not supported at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.readWithMessageConverters(HandlerMethodInvoker.java:651) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker

Custom django management command with appended parameters

自闭症网瘾萝莉.ら 提交于 2019-12-24 11:34:44
问题 My team runs a custom test suite pretty regularly. When we want to run the whole thing, we do ./manage.py test --keepdb --failfast --settings=AE.test_settings When we want to run tests on a specific app, we do the same, but with the app name include. I'd like to make a custom management command that, when called, will run the default test suite, but append the --keepdb, --failfast, and --settings=AE.test_settings params. Ideally something like ./manage.py aetest That can also be run with app